Changeset 273 for trunk/trax/vendor
- Timestamp:
- 01/21/07 21:58:59 (5 years ago)
- Files:
-
- 1 modified
-
trunk/trax/vendor/trax/active_record.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/active_record.php
r272 r273 80 80 * <p>Retrieved from the RDBMS by {@link set_content_columns()}. 81 81 * See {@link 82 * http://pear.php.net/ manual/en/package.database.db.db-common.tableinfo.php82 * http://pear.php.net/package/MDB2/docs/2.3.0/MDB2/MDB2_Driver_Reverse_Common.html#methodtableInfo 83 83 * DB_common::tableInfo()} for the format. <b>NOTE:</b> Some 84 84 * RDBMS's don't return all values.</p> … … 164 164 * Stores the active connections. Indexed on $connection_name. 165 165 */ 166 p ublicstatic $active_connections = array();166 protected static $active_connections = array(); 167 167 168 168 /** … … 170 170 * 171 171 * See {@link 172 * http://pear.php.net/ manual/en/package.database.db.db-common.setfetchmode.php173 * the relevant PEAR DBclass documentation}172 * http://pear.php.net/package/MDB2/docs/2.3.0/MDB2/MDB2_Driver_Common.html#methodsetFetchMode 173 * the relevant PEAR MDB2 class documentation} 174 174 * @var integer 175 175 */ … … 241 241 242 242 /** 243 * @todo Document this property243 * Whether or not to auto save defined associations if set 244 244 * @var boolean 245 245 */ 246 public $auto_save_associations = true; # where or not to auto save defined associations if set246 public $auto_save_associations = true; 247 247 248 248 /** … … 342 342 343 343 /** 344 * @todo Document this variable345 */ 346 public $display = 10; # Pagination how many numbers in the list << < 1 2 3 4 > >>344 * Pagination how many numbers in the list << < 1 2 3 4 > >> 345 */ 346 public $display = 10; 347 347 348 348 /** … … 401 401 'validates_uniqueness_of' 402 402 ); 403 404 /**405 * An array of all the builtin validation function to validate on a save/create/update.406 */407 public $builtins_to_validate = array();408 403 409 404 /** … … 417 412 418 413 /** 419 * @todo Document this variable420 */ 421 public $auto_save_habtm = true; # auto insert / update $has_and_belongs_to_many tables422 423 /** 424 * @todo Document this variable414 * Auto insert / update $has_and_belongs_to_many tables 415 */ 416 public $auto_save_habtm = true; 417 418 /** 419 * Auto delete $has_and_belongs_to_many associations 425 420 */ 426 public $auto_delete_habtm = true; # auto delete $has_and_belongs_to_many associations421 public $auto_delete_habtm = true; 427 422 428 423 /** 429 424 * Transactions (only use if your db supports it) 430 */ 431 private static $begin_executed = false; # this is for transactions only to let query() know that a 'BEGIN' has been executed 425 * This is for transactions only to let query() know that a 'BEGIN' has been executed 426 */ 427 private static $begin_executed = false; 432 428 433 429 /** 434 430 * Transactions (only use if your db supports it) 435 */ 436 public static $use_transactions = false; # this will issue a rollback command if any sql fails 431 * This will issue a rollback command if any sql fails. 432 */ 433 public static $use_transactions = false; 437 434 438 435 /** … … 2533 2530 $connection =& MDB2::Connect($connection_settings, $connection_options); 2534 2531 //static $connect_cnt; $connect_cnt++; error_log("connection #".$connect_cnt); 2532 2533 # For Postgres schemas (http://www.postgresql.org/docs/8.0/interactive/ddl-schemas.html) 2534 if(isset($connection_settings['schema_search_path'])){ 2535 if(!$this->is_error($connection)) { 2536 # Set the schema search path to a string of comma-separated schema names. 2537 # First strip out all the whitespace 2538 self::$connection->query('SET search_path TO '.preg_replace('/\s+/', '', $connection_settings['schema_search_path'])); 2539 } 2540 } 2535 2541 } 2536 2542 if(!$this->is_error($connection)) { 2537 2543 self::$active_connections[$this->connection_name] =& $connection; 2538 2544 self::$db =& $connection; 2545 self::$db->setFetchMode($this->fetch_mode); 2539 2546 } else { 2540 2547 $this->raise($connection->getMessage()); 2541 } 2542 self::$db->setFetchMode($this->fetch_mode); 2548 } 2543 2549 return self::$db; 2544 2550 }
