comanage-dev - Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend
Subject: COmanage Developers List
List archive
Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend
Chronological Thread
- From: Scott Koranda <>
- To: Benn Oshrin <>
- Cc:
- Subject: Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend
- Date: Wed, 12 Sep 2012 11:35:17 -0500
Hi,
On Wed, Sep 12, 2012 at 11:29 AM, Benn Oshrin
<>
wrote:
> On 9/12/12 12:09 PM, Scott Koranda wrote:
>
>> To "fix" that problem I want to add a delete() method for the
>> CoPeopleController.php that dynamically changes the linking
>> between the models to prevent the cascade from affecting the
>> CoGroupMembers model.
>>
>> Here is the proposed code:
>
>
>> // Get a pointer to our model
>> $req = $this->modelClass;
>> $model = $this->$req;
>
>
> You could just reference the model directly, since you know you're in
> CoPeopleController at this point. No need to copy the above.
Fair enough.
>
>> // 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.
>> if (!Configure::read('COmanage.groupSqlDataSource')) {
>
>
> This is possibly going to need to change when CO-444 is addressed. Can you
> add a link to the code from the ticket and vice versa?
Will do.
>
>> $groupMembersLinkValue = $model->hasMany['CoGroupMember'];
>> unset($model->hasMany['CoGroupMember']);
>>
>> // Use the parent method to do the delete.
>> $ret = parent::delete($id);
>>
>> // Restore the model relationship to group memberships if it was
>> deleted.
>> $model->hasMany['CoGroupMember'] = $groupMembersLinkValue;
>
>
> You don't actually delete the group membership. Don't you still need to do
> that?
>
Yes. Have not written that code yet...I wanted to investigate and
address your concern first.
I will take your response as a green light to proceed with the
approach and incorporate the items above.
Cheers,
Scott
- [comanage-dev] change to CoPeopleController.php necessary for Grouper backend, Scott Koranda, 09/12/2012
- Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend, Benn Oshrin, 09/12/2012
- Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend, Scott Koranda, 09/12/2012
- Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend, Benn Oshrin, 09/13/2012
- Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend, Benn Oshrin, 09/13/2012
- Re: [comanage-dev] change to CoPeopleController.php necessary for Grouper backend, Benn Oshrin, 09/12/2012
Archive powered by MHonArc 2.6.16.