Changeset 2459
- Timestamp:
- 04/09/2008 01:23:37 PM (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2-database/system/libraries/Database_Where.php
r2458 r2459 1 <?php //defined('SYSPATH') or die('No direct script access.');1 <?php defined('SYSPATH') or die('No direct script access.'); 2 2 /** 3 3 * Provides database access in a platform agnostic way, using simple query building blocks. … … 14 14 protected $where = array(); 15 15 protected $drivers = array(); 16 17 public function __construct($group = 'default')18 {19 20 }21 16 22 17 public function where() … … 61 56 public function build($group = 'default') 62 57 { 63 if (is_string($group)) 58 if (is_string($group)) // group name was passed 64 59 { 65 60 $config = Config::item('database.'.$group); … … 81 76 // Set driver name 82 77 $driver_class_name = 'Database_'.ucfirst($driver).'_Driver'; 83 78 84 79 // Load the driver 85 80 if ( ! Kohana::auto_load($driver)) 86 81 throw new Kohana_Database_Exception('database.driver_not_supported', $driver_class_name); 87 82 88 83 // Initialize the driver 89 84 $this->drivers[$driver] = new $driver_class_name(); 90 85 91 86 // Validate the driver 92 87 if ( ! ($this->drivers[$driver] instanceof Database_Driver)) … … 99 94 foreach ($this->where as $where) 100 95 { 101 if ( is_object($where[0]))96 if ($where[0] instanceof Database_Where_Core) 102 97 { 103 98 $where_string.=$where[0]->build();
