lithium\data\Entity::__call()

public method

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

mixed

Source

	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);
	}