Author: sevein
Date: Thu Sep 29 12:08:33 2011
New Revision: 9874

Log:
Remove related objects when a digital object is removed (rights)

Modified:
   trunk/lib/model/QubitDigitalObject.php

Modified: trunk/lib/model/QubitDigitalObject.php
==============================================================================
--- trunk/lib/model/QubitDigitalObject.php      Thu Sep 29 11:08:03 2011        
(r9873)
+++ trunk/lib/model/QubitDigitalObject.php      Thu Sep 29 12:08:33 2011        
(r9874)
@@ -376,6 +376,11 @@
     // Delete children
     foreach ($children as $child)
     {
+      foreach (QubitRelation::getBySubjectOrObjectId($this->id) as $item)
+      {
+        $item->delete();
+      }
+
       $child->delete();
     }
 
@@ -385,6 +390,11 @@
       unlink($this->getAbsolutePath());
     }
 
+    foreach (QubitRelation::getBySubjectOrObjectId($this->id) as $item)
+    {
+      $item->delete();
+    }
+
     // Delete self
     parent::delete($connection);
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to