DataObjects/Core_notify.php
authorAlan Knowles <alan@roojs.com>
Wed, 14 Oct 2015 06:40:46 +0000 (14:40 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 14 Oct 2015 06:40:46 +0000 (14:40 +0800)
DataObjects/Core_notify.php

index e73e61c..8199de9 100644 (file)
@@ -51,6 +51,7 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
     function person($set = false)
     {
         if ($set !== false) {
+            $this->person_table = is_object($set) ? $set->tableName() : '';
             $this->person_id = is_object($set) ? $set->id : $set;
             return;
         }
@@ -89,6 +90,23 @@ class Pman_Core_DataObjects_Core_notify extends DB_DataObject
         return false;
         
     }
+    
+    function lookup($obj, $person, $evtype='')
+    {
+        $x = DB_DataObject::Factory($this->tableName());
+        $x->object($obj);
+        $x->person($person);
+        $x->onid = $obj->id;
+        $x->ontable = $obj->tableName;
+        $x->person_table = $person->person_table;
+        $x->
+        $person_table = empty($this->person_table) ? 'Person' : $this->person_table;
+        $col = $person_table == "Person" ? 'person_id' : $person_table . '_id';
+        
+        
+    }
+    
+    
     function beforeDelete($dependants_array, $roo) {
         if ($this->delivered()) {
             $roo->jerr("you can not delete a record of a successfull delivery");