| @@ 91-106 (lines=16) @@ | ||
| 88 | return "https://{$this->host}/api/{$resource}"; |
|
| 89 | } |
|
| 90 | ||
| 91 | public function getBusinessUnits() |
|
| 92 | { |
|
| 93 | $this->login(); |
|
| 94 | $response = $this->request("GET", $this->buildUrl("businessunit"), [ |
|
| 95 | "query" => [ |
|
| 96 | "businessalias" => $this->alias, |
|
| 97 | ] |
|
| 98 | ]); |
|
| 99 | ||
| 100 | $units = []; |
|
| 101 | foreach ($response["Records"] as $unit) { |
|
| 102 | $units[] = new BusinessUnit($unit); |
|
| 103 | } |
|
| 104 | ||
| 105 | return $units; |
|
| 106 | } |
|
| 107 | ||
| 108 | public function getJobs() |
|
| 109 | { |
|
| @@ 108-123 (lines=16) @@ | ||
| 105 | return $units; |
|
| 106 | } |
|
| 107 | ||
| 108 | public function getJobs() |
|
| 109 | { |
|
| 110 | $this->login(); |
|
| 111 | $response = $this->request("GET", $this->buildUrl("job"), [ |
|
| 112 | "query" => [ |
|
| 113 | "businessalias" => $this->alias, |
|
| 114 | ] |
|
| 115 | ]); |
|
| 116 | ||
| 117 | $jobs = []; |
|
| 118 | foreach ($response["Jobs"] as $unit) { |
|
| 119 | $jobs[] = new Job($unit); |
|
| 120 | } |
|
| 121 | ||
| 122 | return $jobs; |
|
| 123 | } |
|
| 124 | ||
| 125 | public function getEmployee($email) |
|
| 126 | { |
|