@@ 339-349 (lines=11) @@ | ||
336 | return $this->get()->first(); |
|
337 | } |
|
338 | ||
339 | public function get() |
|
340 | { |
|
341 | if (in_array('get', $this->methods)) { |
|
342 | $this->response = $this->client->get($this->getEndpoint().$this->getQueryString()); |
|
343 | if ($this->response->getStatusCode() == '200') { |
|
344 | return $this->collect($this->response->getBody()); |
|
345 | } else { |
|
346 | throw new Exception('Status Code '.$this->response->getStatusCode()); |
|
347 | } |
|
348 | } |
|
349 | } |
|
350 | ||
351 | public function all() |
|
352 | { |
|
@@ 351-361 (lines=11) @@ | ||
348 | } |
|
349 | } |
|
350 | ||
351 | public function all() |
|
352 | { |
|
353 | if (in_array('get', $this->methods)) { |
|
354 | $this->response = $this->client->get($this->getEndpoint()); |
|
355 | if ($this->response->getStatusCode() == '200') { |
|
356 | return $this->collect($this->response->getBody()); |
|
357 | } else { |
|
358 | throw new Exception('Status Code '.$this->response->getStatusCode()); |
|
359 | } |
|
360 | } |
|
361 | } |
|
362 | ||
363 | public function find($id) |
|
364 | { |
|
@@ 363-373 (lines=11) @@ | ||
360 | } |
|
361 | } |
|
362 | ||
363 | public function find($id) |
|
364 | { |
|
365 | if (in_array('get', $this->methods)) { |
|
366 | $this->response = $this->client->get($this->getEndpoint().'/'.$id); |
|
367 | if ($this->response->getStatusCode() == '200') { |
|
368 | return $this->collect($this->response->getBody())->first(); |
|
369 | } else { |
|
370 | throw new Exception('Status Code '.$this->response->getStatusCode()); |
|
371 | } |
|
372 | } |
|
373 | } |
|
374 | ||
375 | public function delete($id = '') |
|
376 | { |