Author: sevein
Date: Tue Aug 16 14:10:03 2011
New Revision: 9500
Log:
Remove related QubitRelation before a right is removed
Modified:
trunk/lib/model/QubitRights.php
Modified: trunk/lib/model/QubitRights.php
==============================================================================
--- trunk/lib/model/QubitRights.php Tue Aug 16 14:08:26 2011 (r9499)
+++ trunk/lib/model/QubitRights.php Tue Aug 16 14:10:03 2011 (r9500)
@@ -49,4 +49,15 @@
return parent::insert($connection);
}
+
+ public function delete($connection = null)
+ {
+ // Make sure that the associated QubitRelation object is removed before
+ foreach (QubitRelation::getRelationsByObjectId($this->id, array('typeId'
=> QubitTerm::RIGHT_ID)) as $item)
+ {
+ $item->delete();
+ }
+
+ 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.