Skip to Content.
Sympa Menu

comanage-dev - Re: [comanage-dev] r391 - in registry/trunk: app/Config app/Console/Command app/Controller app/Model app/Plugin app/Plugin/Grouper app/Plugin/Grouper/Config app/Plugin/Grouper/Lib app/Plugin/Grouper/Model app/Plugin/Grouper/Model/Datasource app/View/CoInvites lib/Cake/Model/Datasource

Subject: COmanage Developers List

List archive

Re: [comanage-dev] r391 - in registry/trunk: app/Config app/Console/Command app/Controller app/Model app/Plugin app/Plugin/Grouper app/Plugin/Grouper/Config app/Plugin/Grouper/Lib app/Plugin/Grouper/Model app/Plugin/Grouper/Model/Datasource app/View/CoInvites lib/Cake/Model/Datasource


Chronological Thread 
  • From: Benn Oshrin <>
  • To:
  • Subject: Re: [comanage-dev] r391 - in registry/trunk: app/Config app/Console/Command app/Controller app/Model app/Plugin app/Plugin/Grouper app/Plugin/Grouper/Config app/Plugin/Grouper/Lib app/Plugin/Grouper/Model app/Plugin/Grouper/Model/Datasource app/View/CoInvites lib/Cake/Model/Datasource
  • Date: Mon, 05 Nov 2012 18:11:21 -0500

On 10/25/12 6:56 PM,

wrote:
+ /**
+ * Delete a CoPerson Object. WARNING: this method will delete all
associated data.
+ * This method calls the StandardController delete() method after first
temporarily changing
+ * model dependecies if necessary to compensate for data sources used for
groups and group
+ * memberships that may not use SQL and support cascading deletes.
+ *
+ * - precondition: see StandardController
+ * - postcondition: see StandardController
+ * - postcondition: see StandardController
+ *
+ * @since COmanage Registry v0.8
+ * @param integer Object identifier (eg: cm_co_groups:id) representing
object to be deleted
+ */
+ function delete($id) {
+ // If a data store for groups and group memberships is being used that
+ // is not a relational database supporting SQL then temporarily remove
+ // the model relationship to group memberships.
+ //
+ // May need to revisit at some point due to
+ //https://bugs.internet2.edu/jira/browse/CO-444.
+ if (!Configure::read('COmanage.groupSqlDataSource')) {
+ $groupMembersLinkValue = $this->CoPerson->hasMany['CoGroupMember'];
+ unset($this->CoPerson->hasMany['CoGroupMember']);
+
+ // Use the parent method to do the delete.
+ $ret = parent::delete($id);
+
+ // TODO delete the memberships...

TODO should be flagged as XXX (for consistency with everything else) or using @todo notation in the comment.

-Benn-



Archive powered by MHonArc 2.6.16.

Top of Page