Magic method that allows calling of model methods on this record instance, i.e.: {{{ $record->validates(); }}}

Parameters

  • string $method
  • array $params

Returns

mixed

Source

						public function __call($method, $params) {
		if ($model = $this->_model) {
			$methods = $model::instanceMethods();
			array_unshift($params, $this);

			if (method_exists($model, $method)) {
				$class = $model::invokeMethod('_object');
				return call_user_func_array(array(&$class, $method), $params);
			}
			if (isset($methods[$method]) && is_callable($methods[$method])) {
				return call_user_func_array($methods[$method], $params);
			}
		}
		$message = "No model bound or unhandled method call `{$method}`.";
		throw new BadMethodCallException($message);
	}