yii\base\Object::__call PHP Method

__call() public 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.
public __call ( string $name, array $params ) : mixed
$name string the method name
$params array method parameters
return mixed the method return value
    public function __call($name, $params)
    {
        throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::{$name}()");
    }

Usage Example

示例#1
0
 /**
  * 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);
 }
All Usage Examples Of yii\base\Object::__call