[Solar-svn] Revision 3133

pmjones at solarphp.com pmjones at solarphp.com
Sun Apr 27 11:33:29 CDT 2008


Solar_Sql_Model_Record: [CHG] Method refresh() now attempts to refresh regardless of current status.  Also, takes a param to set the status after refreshing.


Modified: trunk/Solar/Sql/Model/Record.php
===================================================================
--- trunk/Solar/Sql/Model/Record.php	2008-04-25 14:53:58 UTC (rev 3132)
+++ trunk/Solar/Sql/Model/Record.php	2008-04-27 16:33:27 UTC (rev 3133)
@@ -895,15 +895,17 @@
      * @return void
      * 
      */
-    public function refresh()
+    public function refresh($status = null)
     {
-        if ($this->_status != 'new') {
-            $primary = $this->_model->primary_col;
-            $result = $this->_model->fetch($this->$primary);
-            $cols = $this->_model->table_cols;
-            foreach ($cols as $col => $info) {
-                $this->$col = $result->$col;
-            }
+        $primary = $this->_model->primary_col;
+        $result  = $this->_model->fetch($this->$primary);
+        foreach ($this->_model->table_cols as $col => $info) {
+            $this->$col = $result->$col;
+        }
+        
+        if ($status) {
+            $this->setStatus($status)
+        } else {
             $this->setStatus('clean');
         }
     }




More information about the Solar-svn mailing list