@@ 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 |
|
@@ 817-831 (lines=15) @@ | ||
814 | * @throws exceptions\LPTrackerResponseException |
|
815 | * @throws exceptions\LPTrackerServerException |
|
816 | */ |
|
817 | public function getLeadComments($lead) |
|
818 | { |
|
819 | if ($lead instanceof Lead) { |
|
820 | $lead = $lead->getId(); |
|
821 | } else { |
|
822 | $lead = (int) $lead; |
|
823 | } |
|
824 | $url = '/lead/' . $lead . '/comments'; |
|
825 | $response = LPTrackerRequest::sendRequest($url, [], 'GET', $this->token, $this->address); |
|
826 | $result = []; |
|
827 | foreach ($response as $commentData) { |
|
828 | $result[] = new Comment($commentData); |
|
829 | } |
|
830 | return $result; |
|
831 | } |
|
832 | ||
833 | /** |
|
834 | * @param Lead|int $lead |