| @@ 101-115 (lines=15) @@ | ||
| 98 | * @throws exceptions\LPTrackerResponseException |
|
| 99 | * @throws exceptions\LPTrackerServerException |
|
| 100 | */ |
|
| 101 | public function getProjectCustoms($project) |
|
| 102 | { |
|
| 103 | if ($project instanceof Project) { |
|
| 104 | $project = $project->getId(); |
|
| 105 | } else { |
|
| 106 | $project = (int) $project; |
|
| 107 | } |
|
| 108 | $url = '/project/' . $project . '/customs'; |
|
| 109 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 110 | $result = []; |
|
| 111 | foreach ($response as $customData) { |
|
| 112 | $result[] = new Custom($customData); |
|
| 113 | } |
|
| 114 | return $result; |
|
| 115 | } |
|
| 116 | ||
| 117 | /** |
|
| 118 | * @param Project|int $project |
|
| @@ 123-137 (lines=15) @@ | ||
| 120 | * @throws exceptions\LPTrackerResponseException |
|
| 121 | * @throws exceptions\LPTrackerServerException |
|
| 122 | */ |
|
| 123 | public function getProjectFields($project) |
|
| 124 | { |
|
| 125 | if ($project instanceof Project) { |
|
| 126 | $project = $project->getId(); |
|
| 127 | } else { |
|
| 128 | $project = (int) $project; |
|
| 129 | } |
|
| 130 | $url = '/project/' . $project . '/fields'; |
|
| 131 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 132 | $result = []; |
|
| 133 | foreach ($response as $customData) { |
|
| 134 | $result[] = new ContactField($customData); |
|
| 135 | } |
|
| 136 | return $result; |
|
| 137 | } |
|
| 138 | ||
| 139 | /** |
|
| 140 | * @param Project|int $project |
|
| @@ 667-681 (lines=15) @@ | ||
| 664 | * @throws exceptions\LPTrackerResponseException |
|
| 665 | * @throws exceptions\LPTrackerServerException |
|
| 666 | */ |
|
| 667 | public function getLeadComments($lead) |
|
| 668 | { |
|
| 669 | if ($lead instanceof Lead) { |
|
| 670 | $lead = $lead->getId(); |
|
| 671 | } else { |
|
| 672 | $lead = (int) $lead; |
|
| 673 | } |
|
| 674 | $url = '/lead/' . $lead . '/comments'; |
|
| 675 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 676 | $result = []; |
|
| 677 | foreach ($response as $commentData) { |
|
| 678 | $result[] = new Comment($commentData); |
|
| 679 | } |
|
| 680 | return $result; |
|
| 681 | } |
|
| 682 | ||
| 683 | /** |
|
| 684 | * @param Lead|int $lead |
|