blob: 9c78507b7b0957c267b7b3437cfe0ab1b634819f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Model base class.
*
* $Id$
*
* @package Core
* @author Kohana Team
* @copyright (c) 2007-2009 Kohana Team
* @license http://kohanaphp.com/license.html
*/
class Model_Core {
// Database object
protected $db = 'default';
/**
* Loads the database instance, if the database is not already loaded.
*
* @return void
*/
public function __construct()
{
if ( ! is_object($this->db))
{
// Load the default database
$this->db = Database::instance($this->db);
}
}
} // End Model
|