FOF30\Model\Model::__call PHP Method

__call() public method

Magic caller; allows to use the name of model state keys as methods to set their values.
public __call ( string $name, mixed $arguments ) : static
$name string The state variable key
$arguments mixed The state variable contents
return static
    public function __call($name, $arguments)
    {
        $arg1 = array_shift($arguments);
        $this->setState($name, $arg1);
        return $this;
    }

Usage Example

Beispiel #1
0
 public function __call($method, $args)
 {
     if (isset($this->methods[$method])) {
         $func = $this->methods[$method];
         // Let's pass an instance of ourself, so we can manipulate other closures
         array_unshift($args, $this);
         return call_user_func_array($func, $args);
     }
     return parent::__call($method, $args);
 }
All Usage Examples Of FOF30\Model\Model::__call