@@ -62,6 +62,9 @@ discard block |
||
| 62 | 62 | return !$this->isNew(); |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | + /** |
|
| 66 | + * @param string $action |
|
| 67 | + */ |
|
| 65 | 68 | public function path($action = null) { |
| 66 | 69 | $class = get_called_class(); |
| 67 | 70 | $path = $this->isNew() ? $class::element_name_plural() : $class::element_name_plural()."/".$this->_attributes['id']; |
@@ -91,6 +94,9 @@ discard block |
||
| 91 | 94 | } |
| 92 | 95 | } |
| 93 | 96 | |
| 97 | + /** |
|
| 98 | + * @param string $action |
|
| 99 | + */ |
|
| 94 | 100 | private function _request($action) { |
| 95 | 101 | $class = get_called_class(); |
| 96 | 102 | $method = self::methodFor($action); |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | public function parseResponse($response) { |
| 80 | 80 | $status = $response->getStatusCode(); |
| 81 | 81 | if ($status >= 200 && $status <= 299) { |
| 82 | - if($response->json()) { |
|
| 82 | + if ($response->json()) { |
|
| 83 | 83 | $this->_attributes = $response->json(); |
| 84 | 84 | } |
| 85 | 85 | return true; |