/** * Magic method to construct an options model or call an apimethod * @param $method * @param $args * @return mixed */ public function __call($method, $args) { // If the method matches this signature instantiate the options if (preg_match('/^\\w+Options$/', $method)) { return $this->setOptionsObject($method, $args); } if ($method !== 'login' && !$this->apiClient->isAuthenticated()) { $this->apiClient->authenticate(); } if ($this->usesAccountId) { array_unshift($args, $this->apiClient->getAccountId()); } return call_user_func_array([$this->client, $method], $args); }