lithium\data\Model::__call()
Magic method that allows calling Model::_instanceMethods
's closure like normal methods
on the model instance.
Parameters
-
string
$method
Method name caught by
__call()
. -
array
$params
Arguments given to the above
$method
call.
Returns
mixedSource
public function __call($method, $params) {
$methods = static::instanceMethods();
if (isset($methods[$method]) && is_callable($methods[$method])) {
return call_user_func_array($methods[$method], $params);
}
$message = "Unhandled method call `{$method}`.";
throw new BadMethodCallException($message);
}