[Solar-svn] Revision 3070

pmjones at solarphp.com pmjones at solarphp.com
Fri Apr 4 11:18:13 CDT 2008


Solar_Sql_Model: [FIX] Get the primary-key value before removing unchanged columns from the data.


Modified: trunk/Solar/Sql/Model.php
===================================================================
--- trunk/Solar/Sql/Model.php	2008-04-04 15:43:00 UTC (rev 3069)
+++ trunk/Solar/Sql/Model.php	2008-04-04 16:18:08 UTC (rev 3070)
@@ -1720,8 +1720,13 @@
             // apply record filters
             $spec->filter();
             
-            // convert to array, and retain only changed columns.
+            // convert to array
             $data = $spec->toArray();
+            
+            // force the WHERE clause
+            $where = array("$primary = ?" => $data[$primary]);
+            
+            // retain only changed columns
             foreach ($data as $key => $val) {
                 if (! $spec->isChanged($key)) {
                     unset($data[$key]);
@@ -1735,9 +1740,6 @@
                 return $data;
             }
             
-            // force the WHERE clause
-            $where = array("$primary = ?" => $data[$primary]);
-            
         } else {
             // already an array
             $data = $spec;




More information about the Solar-svn mailing list