Changeset 4819

Show
Ignore:
Timestamp:
08/26/08 18:02:11 (2 years ago)
Author:
jwage
Message:

fixing Doctrine_Record::replace()

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Record.php

    r4813 r4819  
    11961196        } else { 
    11971197            $identifier = (array) $this->getTable()->getIdentifier(); 
    1198             return $conn->replace($this->_table, $this->toArray(), $identifier); 
     1198            $data = array(); 
     1199            foreach ($this as $column => $value) { 
     1200                if ($value === self::$_null || is_object($value)) { 
     1201                    $value = null; 
     1202                } 
     1203 
     1204                $data[$column] = $value; 
     1205            } 
     1206 
     1207            return $conn->replace($this->_table, $data, $identifier); 
    11991208        } 
    12001209    }