@@ 774-788 (lines=15) @@ | ||
771 | * @return Lead |
|
772 | * @throws LPTrackerSDKException |
|
773 | */ |
|
774 | public function editLeadStage($lead, $newStageId, array $options = []) |
|
775 | { |
|
776 | if ($lead instanceof Lead) { |
|
777 | $lead = $lead->getId(); |
|
778 | } else { |
|
779 | $lead = (int) $lead; |
|
780 | } |
|
781 | $url = '/lead/' . $lead . '/funnel'; |
|
782 | $data = [ |
|
783 | 'funnel' => $newStageId, |
|
784 | 'options' => $options, |
|
785 | ]; |
|
786 | $response = LPTrackerRequest::sendRequest($url, $data, 'PUT', $this->token, $this->address); |
|
787 | return new Lead($response); |
|
788 | } |
|
789 | ||
790 | /** |
|
791 | * @param Lead|int $lead |
|
@@ 809-823 (lines=15) @@ | ||
806 | * @return Lead |
|
807 | * @throws LPTrackerSDKException |
|
808 | */ |
|
809 | public function editLeadOwner($lead, $newOwnerId, array $options = []) |
|
810 | { |
|
811 | if ($lead instanceof Lead) { |
|
812 | $lead = $lead->getId(); |
|
813 | } else { |
|
814 | $lead = (int) $lead; |
|
815 | } |
|
816 | $url = '/lead/' . $lead . '/owner'; |
|
817 | $data = [ |
|
818 | 'owner' => $newOwnerId, |
|
819 | 'options' => $options, |
|
820 | ]; |
|
821 | $response = LPTrackerRequest::sendRequest($url, $data, 'PUT', $this->token, $this->address); |
|
822 | return new Lead($response); |
|
823 | } |
|
824 | ||
825 | /** |
|
826 | * @param Lead|int $lead |
|
@@ 855-869 (lines=15) @@ | ||
852 | * @throws exceptions\LPTrackerResponseException |
|
853 | * @throws exceptions\LPTrackerServerException |
|
854 | */ |
|
855 | public function addCommentToLead($lead, $text, array $options = []) |
|
856 | { |
|
857 | if ($lead instanceof Lead) { |
|
858 | $lead = $lead->getId(); |
|
859 | } else { |
|
860 | $lead = (int) $lead; |
|
861 | } |
|
862 | $url = '/lead/' . $lead . '/comment'; |
|
863 | $data = [ |
|
864 | 'text' => $text, |
|
865 | 'options' => $options, |
|
866 | ]; |
|
867 | $response = LPTrackerRequest::sendRequest($url, $data, 'POST', $this->token, $this->address); |
|
868 | return new Comment($response); |
|
869 | } |
|
870 | ||
871 | /** |
|
872 | * @param Lead|int $lead |