The last I checked, if your tables are MySQL InnoDB and have RI
defined in the DB, you can't use Cake's 'dependent' feature. Cake will
attempt delete the parent record first, then any child records. With
RI set, MySQL will throw a constraint error when the parent record
delete is attempted.

Actually, I just thought of something: I wonder if it's possible to
make this work by issuing a "SET FOREIGN_KEY_CHECKS=0;" command in the
"beforeDelete" callback? Interesting. I'll have to try that sometime.

NOSLOW

On Jul 31, 7:04 pm, rtanz <[EMAIL PROTECTED]> wrote:
> hi i am looking at the model part of the manual, in the SAVING RELATED
> MODEL DATA section. here there is an example of saving a new post and
> a related comment. now if the post were to be deleted at a later
> stage, would the comment be deleted automatically (provided that
> 'dependent' is set to true in the association parameters)?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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