Changeset 1085
- Timestamp:
- 11/11/2007 01:31:18 AM (13 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/Model.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/Model.php
r1015 r1085 12 12 /* 13 13 * Constructor: __construct 14 * Loads database into '$this->db'.14 * Loads database to $this->db. 15 15 */ 16 16 public function __construct() 17 17 { 18 18 // Load the database into the model 19 $this->db = isset(Kohana::instance()->db) ? Kohana::instance()->db : new Database('default'); 19 if (Event::has_run('system.pre_controller')) 20 { 21 $this->db = isset(Kohana::instance()->db) ? Kohana::instance()->db : new Database('default'); 22 } 23 else 24 { 25 $this->db = new Database('default'); 26 } 20 27 } 21 28
