@@ 81-92 (lines=12) @@ | ||
78 | return "https://{$this->host}/api/{$resource}"; |
|
79 | } |
|
80 | ||
81 | public function getBusinessUnits() |
|
82 | { |
|
83 | $this->login(); |
|
84 | $response = $this->request('GET', $this->buildUrl("businessunit?businessalias={$this->alias}")); |
|
85 | ||
86 | $units = []; |
|
87 | foreach ($response["Records"] as $unit) { |
|
88 | $units[] = new BusinessUnit($unit); |
|
89 | } |
|
90 | ||
91 | return $units; |
|
92 | } |
|
93 | ||
94 | public function getJobs() |
|
95 | { |
|
@@ 94-105 (lines=12) @@ | ||
91 | return $units; |
|
92 | } |
|
93 | ||
94 | public function getJobs() |
|
95 | { |
|
96 | $this->login(); |
|
97 | $response = $this->request('GET', $this->buildUrl("job?businessalias={$this->alias}")); |
|
98 | ||
99 | $jobs = []; |
|
100 | foreach ($response["Jobs"] as $unit) { |
|
101 | $jobs[] = new Job($unit); |
|
102 | } |
|
103 | ||
104 | return $jobs; |
|
105 | } |
|
106 | ||
107 | protected function login() |
|
108 | { |