DataObjects/Mtrack_change.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 24 Mar 2011 15:31:44 +0000 (23:31 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 24 Mar 2011 15:31:44 +0000 (23:31 +0800)
DataObjects/Mtrack_change.php

index 61f3088..5006893 100644 (file)
@@ -142,15 +142,7 @@ class Pman_MTrack_DataObjects_Mtrack_change extends DB_DataObject
     {
         $ret = 0;
         if (is_object($fieldname)) {
-            $old = $new;
-            $new = $fieldname;
-            
-            // should check keys() - so it does not log primary key addition.
-            foreach($new->toArray() as $k=>$v) {
-                // things to skip?
-                $ret+=$this->add(  $k,  $v, !$old ? '':  $old->{$k});
-            };
-            return $ret;
+            return $this->add($this->ontable.':'. $this->onid , $fieldname, $new );  
         }
         if (is_object($new)) {
             // should check keys() - so it does not log primary key addition.