DataObjects/Mtrack_change.php
authorAlan Knowles <alan@akbkhome.com>
Thu, 24 Mar 2011 14:48:55 +0000 (22:48 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 24 Mar 2011 14:48:55 +0000 (22:48 +0800)
DataObjects/Mtrack_change.php

index 70e3fac..ad5a3b4 100644 (file)
@@ -140,6 +140,14 @@ class Pman_MTrack_DataObjects_Mtrack_change extends DB_DataObject
     function add($fieldname, $old, $new)
     {
         
+        if (is_object($fieldname)) {
+            // should check keys() - so it does not log primary key addition.
+            foreach($new->toArray() as $k=>$v) {
+                // things to skip?
+                $this->add($k, $v, !$old ? '' :  $old->{$k});
+            }
+            return;
+        }
         if (is_object($new)) {
             // should check keys() - so it does not log primary key addition.
             foreach($new->toArray() as $k=>$v) {