abstract Model
› Kohana_Model
Class Contents
Class declared in SYSPATH/classes/model.php on line 3.
Methods
public __construct( )
› Kohana_Model
Source Code
public function __construct($db = NULL)
{
if ($db)
{
// Set the database instance to use
$this->_db = $db;
}
elseif ( ! $this->_db)
{
// Use the global database
$this->_db = Database::$default;
}
if (is_string($this->_db))
{
// Load the database
$this->_db = Database::instance($this->_db);
}
}
public static factory( )
› Kohana_Model
Source Code
public static function factory($name, $db = NULL)
{
// Add the model prefix
$class = 'Model_'.$name;
return new $class($db);
}