root/trunk/system/libraries/Model.php

Revision 3700, 496 bytes (checked in by Shadowhand, 12 days ago)

Updates to trunk:

  • Removed all SYSPATH file checks
  • Deleted some modules: code_coverage (3.0), shoutbox (defunct), user_guide (defunct), kobot (3.0), object_db (3.0)
  • Updated ORM and ORM_Iterator to match 3.0, enabling the new HABTM stuff, see r3636 and r3640
  • Property svn:eol-style set to LF
  • Property copyright set to Copyright (c) 2007 Kohana Team
  • Property svn:keywords set to Id
Line 
1<?php
2/**
3 * Model base class.
4 *
5 * $Id$
6 *
7 * @package    Core
8 * @author     Kohana Team
9 * @copyright  (c) 2007-2008 Kohana Team
10 * @license    http://kohanaphp.com/license.html
11 */
12class Model_Core {
13
14    protected $db;
15
16    /**
17     * Loads the database instance, if the database is not already loaded.
18     *
19     * @return  void
20     */
21    public function __construct()
22    {
23        if ( ! is_object($this->db))
24        {
25            // Load the default database
26            $this->db = Database::instance('default');
27        }
28    }
29
30} // End Model
Note: See TracBrowser for help on using the browser.