| @@ 646-659 (lines=14) @@ | ||
| 643 | * @return Lead |
|
| 644 | * @throws LPTrackerSDKException |
|
| 645 | */ |
|
| 646 | public function changeLeadFunnel($lead, $newFunnelId) |
|
| 647 | { |
|
| 648 | if ($lead instanceof Lead) { |
|
| 649 | $lead = $lead->getId(); |
|
| 650 | } else { |
|
| 651 | $lead = (int) $lead; |
|
| 652 | } |
|
| 653 | $url = '/lead/' . $lead . '/funnel'; |
|
| 654 | $data = [ |
|
| 655 | 'funnel' => $newFunnelId, |
|
| 656 | ]; |
|
| 657 | $response = LPTrackerRequest::sendRequest($url, $data, 'PUT', $this->token, $this->address); |
|
| 658 | return new Lead($response); |
|
| 659 | } |
|
| 660 | ||
| 661 | /** |
|
| 662 | * @param Lead|int $lead |
|
| @@ 690-703 (lines=14) @@ | ||
| 687 | * @throws exceptions\LPTrackerResponseException |
|
| 688 | * @throws exceptions\LPTrackerServerException |
|
| 689 | */ |
|
| 690 | public function addCommentToLead($lead, $text) |
|
| 691 | { |
|
| 692 | if ($lead instanceof Lead) { |
|
| 693 | $lead = $lead->getId(); |
|
| 694 | } else { |
|
| 695 | $lead = (int) $lead; |
|
| 696 | } |
|
| 697 | $url = '/lead/' . $lead . '/comment'; |
|
| 698 | $data = [ |
|
| 699 | 'text' => $text, |
|
| 700 | ]; |
|
| 701 | $response = LPTrackerRequest::sendRequest($url, $data, 'POST', $this->token, $this->address); |
|
| 702 | return new Comment($response); |
|
| 703 | } |
|
| 704 | ||
| 705 | /** |
|
| 706 | * @param Lead|int $lead |
|
| @@ 790-800 (lines=11) @@ | ||
| 787 | * @throws exceptions\LPTrackerResponseException |
|
| 788 | * @throws exceptions\LPTrackerServerException |
|
| 789 | */ |
|
| 790 | public function createCustom($project, $options) |
|
| 791 | { |
|
| 792 | if ($project instanceof Project) { |
|
| 793 | $project = $project->getId(); |
|
| 794 | } else { |
|
| 795 | $project = (int) $project; |
|
| 796 | } |
|
| 797 | $actionUrl = '/custom/' . $project . '/create'; |
|
| 798 | $response = LPTrackerRequest::sendRequest($actionUrl, $options, 'POST', $this->token, $this->address); |
|
| 799 | return new CustomField($response); |
|
| 800 | } |
|
| 801 | ||
| 802 | /** |
|
| 803 | * @param Project|int $project |
|