root

Changeset 478

Show
Ignore:
Timestamp:
01/12/09 00:44:47 (2 years ago)
Author:
wbond
Message:

Changed fActiveRecord::__construct() to populate database default values when a non-existing record is instantiated

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fActiveRecord.php

    r477 r478 Hide Line Numbers
    1515 * @link       http://flourishlib.com/fActiveRecord 
    1616 *  
    17  * @version    1.0.0b8 
     17 * @version    1.0.0b9 
     18 * @changes    1.0.0b9  Changed ::__construct() to populate database default values when a non-existing record is instantiated [wb, 2009-01-12] 
    1819 * @changes    1.0.0b8  Fixed ::exists() to properly detect cases when an existing record has one or more NULL values in the primary key [wb, 2009-01-11] 
    1920 * @changes    1.0.0b7  Fixed ::__construct() to not trigger the post::__construct() hook when force-configured [wb, 2008-12-30] 
     
    528529            foreach ($column_info as $column => $info) { 
    529530                $this->values[$column] = NULL; 
     531                if ($info['default'] !== NULL) { 
     532                    self::assign( 
     533                        $this->values, 
     534                        $this->old_values, 
     535                        $column, 
     536                        fORM::objectify($this, $column, $info['default']) 
     537                    );   
     538                } 
    530539            } 
    531540        }