| @@ 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 |
|
| @@ 633-647 (lines=15) @@ | ||
| 630 | * @throws exceptions\LPTrackerResponseException |
|
| 631 | * @throws exceptions\LPTrackerServerException |
|
| 632 | */ |
|
| 633 | public function getLeadComments($lead) |
|
| 634 | { |
|
| 635 | if ($lead instanceof Lead) { |
|
| 636 | $lead = $lead->getId(); |
|
| 637 | } else { |
|
| 638 | $lead = (int) $lead; |
|
| 639 | } |
|
| 640 | $url = '/lead/' . $lead . '/comments'; |
|
| 641 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
| 642 | $result = []; |
|
| 643 | foreach ($response as $commentData) { |
|
| 644 | $result[] = new Comment($commentData); |
|
| 645 | } |
|
| 646 | return $result; |
|
| 647 | } |
|
| 648 | ||
| 649 | /** |
|
| 650 | * @param Lead|int $lead |
|