DataObjects/Core_enum.php
authorEdward <edward@roojs.com>
Thu, 4 Jun 2015 08:40:11 +0000 (16:40 +0800)
committerEdward <edward@roojs.com>
Thu, 4 Jun 2015 08:40:11 +0000 (16:40 +0800)
DataObjects/Core_enum.php

index d8a2e68..630cc3d 100644 (file)
@@ -355,6 +355,29 @@ class Pman_Core_DataObjects_Core_enum extends DB_DataObject
             }
         }
         
+        foreach($affects as $k => $true) {
+            $ka = explode('.', $k);
+
+            $chk = DB_DataObject::factory($ka[0]);
+            if (!is_a($chk,'DB_DataObject')) {
+                $this->jerr('Unable to load referenced table, check the links config: ' .$ka[0]);
+            }
+           // print_r(array($chk->tablename() , $ka[1] ,  $xx->tablename() , $this->key ));
+            $chk->{$ka[1]} =  $xx->{$this->key};
+
+            if (count($chk->keys())) {
+                $matches = $chk->count();
+            } else {
+                //DB_DataObject::DebugLevel(1);
+                $matches = $chk->count($ka[1]);
+            }
+
+            if ($matches) {
+                $chk->_match_key = $ka[1];
+                $match_ar[] = clone($chk);
+                continue;
+            }          
+        }
         
     }