| @@ 115-129 (lines=15) @@ | ||
| 112 | * @throws exceptions\LPTrackerResponseException |
|
| 113 | * @throws exceptions\LPTrackerServerException |
|
| 114 | */ |
|
| 115 | public function getProjectCustoms($project) |
|
| 116 | { |
|
| 117 | if ($project instanceof Project) { |
|
| 118 | $project = $project->getId(); |
|
| 119 | } else { |
|
| 120 | $project = (int) $project; |
|
| 121 | } |
|
| 122 | $url = '/project/' . $project . '/customs'; |
|
| 123 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 124 | $result = []; |
|
| 125 | foreach ($response as $customData) { |
|
| 126 | $result[] = new Custom($customData); |
|
| 127 | } |
|
| 128 | return $result; |
|
| 129 | } |
|
| 130 | ||
| 131 | /** |
|
| 132 | * @param Project|int $project |
|
| @@ 137-151 (lines=15) @@ | ||
| 134 | * @throws exceptions\LPTrackerResponseException |
|
| 135 | * @throws exceptions\LPTrackerServerException |
|
| 136 | */ |
|
| 137 | public function getProjectStages($project) |
|
| 138 | { |
|
| 139 | if ($project instanceof Project) { |
|
| 140 | $project = $project->getId(); |
|
| 141 | } else { |
|
| 142 | $project = (int) $project; |
|
| 143 | } |
|
| 144 | $url = '/project/' . $project . '/funnel'; |
|
| 145 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 146 | $result = []; |
|
| 147 | foreach ($response as $stageData) { |
|
| 148 | $result[] = new Stage($stageData); |
|
| 149 | } |
|
| 150 | return $result; |
|
| 151 | } |
|
| 152 | ||
| 153 | /** |
|
| 154 | * @param Project|int $project |
|
| @@ 159-173 (lines=15) @@ | ||
| 156 | * @throws exceptions\LPTrackerResponseException |
|
| 157 | * @throws exceptions\LPTrackerServerException |
|
| 158 | */ |
|
| 159 | public function getProjectFields($project) |
|
| 160 | { |
|
| 161 | if ($project instanceof Project) { |
|
| 162 | $project = $project->getId(); |
|
| 163 | } else { |
|
| 164 | $project = (int) $project; |
|
| 165 | } |
|
| 166 | $url = '/project/' . $project . '/fields'; |
|
| 167 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 168 | $result = []; |
|
| 169 | foreach ($response as $customData) { |
|
| 170 | $result[] = new ContactField($customData); |
|
| 171 | } |
|
| 172 | return $result; |
|
| 173 | } |
|
| 174 | ||
| 175 | /** |
|
| 176 | * @param Project|int $project |
|
| @@ 774-788 (lines=15) @@ | ||
| 771 | * @throws exceptions\LPTrackerResponseException |
|
| 772 | * @throws exceptions\LPTrackerServerException |
|
| 773 | */ |
|
| 774 | public function getLeadComments($lead) |
|
| 775 | { |
|
| 776 | if ($lead instanceof Lead) { |
|
| 777 | $lead = $lead->getId(); |
|
| 778 | } else { |
|
| 779 | $lead = (int) $lead; |
|
| 780 | } |
|
| 781 | $url = '/lead/' . $lead . '/comments'; |
|
| 782 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 783 | $result = []; |
|
| 784 | foreach ($response as $commentData) { |
|
| 785 | $result[] = new Comment($commentData); |
|
| 786 | } |
|
| 787 | return $result; |
|
| 788 | } |
|
| 789 | ||
| 790 | /** |
|
| 791 | * @param Lead|int $lead |
|