| @@ 37-53 (lines=17) @@ | ||
| 34 | * |
|
| 35 | * @return \Acquia\LiftClient\Entity\Goal[] |
|
| 36 | */ |
|
| 37 | public function query($options = []) |
|
| 38 | { |
|
| 39 | $url = '/goals'; |
|
| 40 | $url .= $this->getQueryString($options); |
|
| 41 | ||
| 42 | // Now make the request. |
|
| 43 | $request = new Request('GET', $url); |
|
| 44 | $data = $this->getResponseJson($request); |
|
| 45 | ||
| 46 | // Get them as Goal objects |
|
| 47 | $goals = []; |
|
| 48 | foreach ($data as $dataItem) { |
|
| 49 | $goals[] = new Goal($dataItem); |
|
| 50 | } |
|
| 51 | ||
| 52 | return $goals; |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Get a specific goal. |
|
| @@ 47-63 (lines=17) @@ | ||
| 44 | * |
|
| 45 | * @return \Acquia\LiftClient\Entity\Rule[] |
|
| 46 | */ |
|
| 47 | public function query($options = []) |
|
| 48 | { |
|
| 49 | $url = '/rules'; |
|
| 50 | $url .= $this->getQueryString($options); |
|
| 51 | ||
| 52 | // Now make the request. |
|
| 53 | $request = new Request('GET', $url); |
|
| 54 | $data = $this->getResponseJson($request); |
|
| 55 | ||
| 56 | // Get them as Rule objects |
|
| 57 | $rules = []; |
|
| 58 | foreach ($data as $dataItem) { |
|
| 59 | $rules[] = new Rule($dataItem); |
|
| 60 | } |
|
| 61 | ||
| 62 | return $rules; |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * Get a specific rule. |
|
| @@ 37-53 (lines=17) @@ | ||
| 34 | * |
|
| 35 | * @return \Acquia\LiftClient\Entity\Slot[] |
|
| 36 | */ |
|
| 37 | public function query($options = []) |
|
| 38 | { |
|
| 39 | $url = '/slots'; |
|
| 40 | $url .= $this->getQueryString($options); |
|
| 41 | ||
| 42 | // Now make the request. |
|
| 43 | $request = new Request('GET', $url); |
|
| 44 | $data = $this->getResponseJson($request); |
|
| 45 | ||
| 46 | // Get them as Slot objects |
|
| 47 | $slots = []; |
|
| 48 | foreach ($data as $dataItem) { |
|
| 49 | $slots[] = new Slot($dataItem); |
|
| 50 | } |
|
| 51 | ||
| 52 | return $slots; |
|
| 53 | } |
|
| 54 | ||
| 55 | /** |
|
| 56 | * Get a specific slot. |
|