2009-04-07 18:37:48 +03:00
|
|
|
<?php defined('SYSPATH') or die('No direct script access.');
|
|
|
|
/**
|
|
|
|
* Model base class.
|
|
|
|
*
|
|
|
|
* @package Kohana
|
|
|
|
* @author Kohana Team
|
|
|
|
* @copyright (c) 2008-2009 Kohana Team
|
|
|
|
* @license http://kohanaphp.com/license.html
|
|
|
|
*/
|
|
|
|
abstract class Model_Core {
|
|
|
|
|
2009-04-09 23:46:12 +03:00
|
|
|
// Database instance
|
2009-04-07 18:37:48 +03:00
|
|
|
protected $_db = 'default';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the database.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
if (is_string($this->_db))
|
|
|
|
{
|
|
|
|
// Load the database
|
2009-04-09 23:46:12 +03:00
|
|
|
$this->_db = Database::instance($this->_db);
|
2009-04-07 18:37:48 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // End Model
|