lithium\data\Entity::__call()

public method

Magic method that allows calling of model methods on this record instance.

$post->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);
			return call_user_func_array([$model::object(), $method], $params);
		}
		$message = "No model bound to call `{$method}`.";
		throw new BadMethodCallException($message);
	}