Author: jwage
Date: 2008-08-27 21:51:37 +0100 (Wed, 27 Aug 2008)
New Revision: 4853

Modified:
   branches/1.0/lib/Doctrine/Record.php
Log:
fixes #1308


Modified: branches/1.0/lib/Doctrine/Record.php
===================================================================
--- branches/1.0/lib/Doctrine/Record.php        2008-08-27 20:26:49 UTC (rev 
4852)
+++ branches/1.0/lib/Doctrine/Record.php        2008-08-27 20:51:37 UTC (rev 
4853)
@@ -1252,17 +1252,13 @@
         if ($this->exists()) {
             return $this->save();
         } else {
-            $identifier = (array) $this->getTable()->getIdentifier();
-            $data = array();
-            foreach ($this as $column => $value) {
-                if ($value === self::$_null || is_object($value)) {
-                    $value = null;
-                }
-
-                $data[$column] = $value;
+            if ($this->isValid()) {
+                $identifier = (array) $this->getTable()->getIdentifier();
+                $data = $this->getPrepared();
+                return $conn->replace($this->_table, $data, $identifier);
+            } else {
+                return false;
             }
-
-            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