Thursday, February 24, 2011

Re: hasMany: check for depending objects when deleting and deny?

I created a behavior that automatically does just this. I wrote about
it in my blog:

Automatically prevent records with depending children from being
deleted: http://josh.ch/wordpress/?p=80

I hope somebody will this useful. Please comment on it, I'm happy to
optimize it if needed. :-)

On Tue, Oct 19, 2010 at 4:15 PM, Joshua Muheim <psybear83@gmail.com> wrote:
> So it seems there's no such functionality yet? I will try to create a
> component or something for this...
>
> On Thu, Sep 16, 2010 at 12:17 PM, Jeremy Burns | Class Outfit
> <jeremyburns@classoutfit.com> wrote:
>> Go directly to the source; use referential integrity in InnoDB.
>>
>> Jeremy Burns
>> Class Outfit
>>
>> jeremyburns@classoutfit.com
>> http://www.classoutfit.com
>>
>> On 16 Sep 2010, at 11:12, psybear83 wrote:
>>
>>> Hi all
>>>
>>> I know that I can use the dependent flag to automatically delete all
>>> the associated model objects.
>>>
>>> But I'd rather have an option to prevent deletion of the object as
>>> long as it's having other depending objects. Is there an easy way to
>>> do this?
>>>
>>> Thanks a lot
>>> Josh
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
>>
>

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: