Kohana_ORM_Behavior
Constants
- None
Properties
Properties
-
protected Database_Query_Builder_Select $_config
-
Database query builder
-
Default value:
NULL
Methods
public static factory(string $behavior [, mixed $config = NULL ] ) (defined in Kohana_ORM_Behavior)
Creates and returns a new ORM behavior.
Parameters
- string $behavior required - $type Type name
- mixed $config = NULL - $id Parameter for find()
Tags
Return Values
- ORM
Source Code
public static function factory($behavior, $config = NULL)
{
if ( ! is_string($behavior) AND is_array($config))
{
if ( ! is_callable($config))
throw new Kohana_Exception('Behavior cannot be created: function does not exists');
// This is either a callback as an array or a lambda
return new ORM_Behavior_LocalBehavior($config);
}
// Set class name
$behavior_name = 'ORM_Behavior_'.ucfirst($behavior);
return new $behavior_name($config);
}
public on_construct() (defined in Kohana_ORM_Behavior)
Source Code
public function on_construct($model, $id) { return TRUE; }
public on_create() (defined in Kohana_ORM_Behavior)
Source Code
public function on_create($model) { }
public on_update() (defined in Kohana_ORM_Behavior)
Source Code
public function on_update($model) { }
protected __construct() (defined in Kohana_ORM_Behavior)
Source Code
protected function __construct($config)
{
$this->_config = $config;
}