yii\base\Component::__call PHP Метод

__call() публичный Метод

This method will check if any attached behavior has the named method and will execute it if available. 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
Результат mixed the method return value
    public function __call($name, $params)
    {
        $this->ensureBehaviors();
        foreach ($this->_behaviors as $object) {
            if ($object->hasMethod($name)) {
                return call_user_func_array([$object, $name], $params);
            }
        }
        throw new UnknownMethodException('Calling unknown method: ' . get_class($this) . "::{$name}()");
    }

Usage Example

Пример #1
0
 public function __call($name, $parameters)
 {
     if (method_exists($this->_api, $name)) {
         return call_user_func_array(array($this->_api, $name), $parameters);
     }
     return parent::__call($name, $parameters);
 }
All Usage Examples Of yii\base\Component::__call