Author: jwage
Date: 2008-08-26 23:02:11 +0100 (Tue, 26 Aug 2008)
New Revision: 4819

Modified:
   branches/1.0/lib/Doctrine/Record.php
Log:
fixing Doctrine_Record::replace()


Modified: branches/1.0/lib/Doctrine/Record.php
===================================================================
--- branches/1.0/lib/Doctrine/Record.php        2008-08-26 21:53:15 UTC (rev 
4818)
+++ branches/1.0/lib/Doctrine/Record.php        2008-08-26 22:02:11 UTC (rev 
4819)
@@ -1195,7 +1195,16 @@
             return $this->save();
         } else {
             $identifier = (array) $this->getTable()->getIdentifier();
-            return $conn->replace($this->_table, $this->toArray(), 
$identifier);
+            $data = array();
+            foreach ($this as $column => $value) {
+                if ($value === self::$_null || is_object($value)) {
+                    $value = null;
+                }
+
+                $data[$column] = $value;
+            }
+
+            return $conn->replace($this->_table, $data, $identifier);
         }
     }
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to