setClient($client); } /** * Sets the API client. * * @param CApiClient $client */ public function setClient(CApiClient $client) { $this->client = $client; } /** * Returns the API client. * * @return CApiClient */ public function getClient() { return $this->client; } /** * A magic method for calling the public methods of the API client. * * @param string $method API method name * @param array $params API method parameters * * @return CApiClientResponse */ public function __call($method, array $params) { return $this->callMethod($method, reset($params)); } /** * Pre-process and call the client method. * * @param string $method API method name * @param array $params API method parameters * * @return CApiClientResponse */ protected function callMethod($method, array $params) { return $this->callClientMethod($method, $params); } /** * Call the client method and return the result. * * @param string $method API method name * @param array $params API method parameters * * @return CApiClientResponse */ protected function callClientMethod($method, array $params) { return $this->client->callMethod($this->api, $method, $params, $this->auth); } }