Merge branch 'maint/7.0'
[ninja.git] / system / libraries / Model.php
blob4b985f22b82d1e301a0978ee0911371ffc2ca332
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * Model base class.
5 * $Id: Model.php 3917 2009-01-21 03:06:22Z zombor $
7 * @package Core
8 * @author Kohana Team
9 * @copyright (c) 2007-2009 Kohana Team
10 * @license http://kohanaphp.com/license.html
12 class Model {
14 // Database object
15 protected $db;
17 /**
18 * Loads the database instance, if the database is not already loaded.
20 * @return void
22 public function __construct()
24 if ( ! is_object($this->db))
26 // Load the default database
27 $this->db = Database::instance('default');
31 } // End Model