Set 'dependent'=>true in your $hasMany definition.  See
http://manual.cakephp.org/chapter/models for more details.


On Dec 4, 2:56 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi, I'm new to cakePHP and I'm wondering if there is an easy way to
> setup automatic referential data integrity so that when I delete a
> parent, all of it's children are automatically deleted? Right now I
> have a $hasMany relationship setup in the parent's model and a
> $belongsTo relationship setup in the child's model. As it is now, when
> I delete a parent data objects, it's children are not deleted. If you
> know how to do this, other then manually deleting all of the children
> in the parents delete function, let me know.
>
> Thanks,
> Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to