/** * Calls the method contained in the actions of this resource * * @param string $method * @param array $args * * @return \StdClass The JSON decoded response */ public function __call($method, $args) { $action = $this->getActions()[$method]; $uri = $this->getBaseUri() . $this->getPath($action, $args); $params = $this->getParams($args); $this->last_response = $this->client->request($action['method'], $uri, $params); $response = $this->last_response->getBody(); return $this->parse($response); }
/** * @param $type * @param $url * @param array $data * @param array $headers * @return bool|mixed */ public function request($type, $url, array $data = null, array $headers = array(), $content_type = null) { $url = trim($this->getRequestUrl($url), '/'); if ($response = parent::request($type, $url, $data, $headers, $content_type)) { return $response; } return false; }