DataObjects/Core_domain.php
[Pman.Core] / RooPostTrait.php
index 8c1f5fe..b71a458 100644 (file)
@@ -66,7 +66,7 @@ trait Pman_Core_RooPostTrait {
      *
      * CALLS BEFORE change occurs:
      *  
-     *      beforeDelete($dependants_array, $roo)
+     *      beforeDelete($dependants_array, $roo, $request)
      *                      Argument is an array of un-find/fetched dependant items.
      *                      - jerr() will stop insert.. (Prefered)
      *                      - return false for fail and set DO->err;
@@ -282,9 +282,7 @@ trait Pman_Core_RooPostTrait {
           
             }
             
-            DB_DataObject::Factory('Events')->logDeletedRecord($x);
-            
-            $this->addEvent("DELETE", $x);
+            $this->logDeleteEvent($x);
             
             $xx->delete();
             
@@ -301,6 +299,17 @@ trait Pman_Core_RooPostTrait {
         
     }
     
+    function logDeleteEvent($object)
+    {
+        
+        DB_DataObject::Factory('Events')->logDeletedRecord($object);
+        
+        $this->addEvent("DELETE", $object);
+          
+        
+    }
+    
+    
     function update($x, $req,  $with_perm_check = true)
     {
         if ( $with_perm_check && !$this->checkPerm($x,'E', $req) )  {