lithium\data\Entity::__call()
Magic method that allows calling of model methods on this record instance, i.e.:
$record->validates();
Parameters
-
string
$method
Method name caught by
__call()
. -
array
$params
Arguments given to the above
$method
call.
Returns
mixedSource
public function __call($method, $params) {
if (($model = $this->_model) && method_exists($model, '_object')) {
array_unshift($params, $this);
$class = $model::invokeMethod('_object');
return call_user_func_array(array(&$class, $method), $params);
}
$message = "No model bound to call `{$method}`.";
throw new BadMethodCallException($message);
}