The faster is using cascade, because it handled at a lower level than
the application level.
However, it's safer to delete related model through "dependent",
specially when this model implements a beforeDelete or afterDelete
callbacks (do not forhet the attached behaviors). When it's not
handled by the app, these callbacks won't be called.

Hope this help!

On 10 abr, 13:45, Mateusz Kaczanowski <kangu...@gmail.com> wrote:
> Hi guys,
>
> In CakePHP we delete related records by dependency in model. Which way us
> better
>
> 1. Set up CASCADE in innodb mysql database
> 2. Use dependent in cakePHP model
>
> "Better" - I mean faster , safer .
>
> Thanks for answers

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to