/** * Calls the named method which is not a class method. * * Do not call this method directly as it is a PHP magic method that * will be implicitly called when an unknown method is being invoked. * @param string $method the method name * @param array $params method parameters * @throws UnknownMethodException when calling unknown method * @return mixed the method return value */ public function __call($method, $params) { // TODO: Change the autogenerated stub if (method_exists($this->instance, $method)) { return call_user_func_array([$this->instance, $method], $params); } parent::__call($method, $params); }
public function __call($name, $parameters) { // check methods of xs if ($this->xs !== null && method_exists($this->xs, $name)) { return call_user_func_array(array($this->xs, $name), $parameters); } // check methods of index object if ($this->xs !== null && method_exists(__NAMESPACE__ . '\\XSIndex', $name)) { $ret = call_user_func_array(array($this->xs->index, $name), $parameters); if ($ret === $this->xs->index) { return $this; } return $ret; } // check methods of search object if ($this->xs !== null && method_exists(__NAMESPACE__ . '\\XSSearch', $name)) { $ret = call_user_func_array(array($this->xs->search, $name), $parameters); if ($ret === $this->xs->search) { return $this; } return $ret; } return parent::__call($name, $parameters); }
/** * Calls the named method which is not a class method. * * Do not call this method directly as it is a PHP magic method that * will be implicitly called when an unknown method is being invoked. * * @param string $name the method name * @param array $arguments method parameters * * @return mixed the method return value */ public function __call($name, $arguments) { if ($name === 'default') { return call_user_func_array([$this, '_default'], $arguments); } return parent::__call($name, $arguments); }
/** * @param string $name * @param array $params * @return mixed */ public function __call($name, $params) { $property = lcfirst(substr($name, 3)); if (substr($name, 0, 3) === 'get') { if (isset($this->params[$property])) { return $this->params[$property]; } elseif (isset($params[0])) { return $params[0]; } } elseif (substr($name, 0, 3) === 'has') { return isset($this->params[$property]); } return parent::__call($name, $params); }