Yes, look at the models deleteAll method at: http://book.cakephp.org/view/692/deleteAll
Using your child model, call the deleteAll method with the conditions that all records with the parent id (the A) is to be deleted. Enjoy, John On Mar 17, 6:49 am, guille1983 <[email protected]> wrote: > is there a cake magic way to delete all children models of a given > model ? I just want to delete childs not the main model. > > Let me explain it to you > > Model A has many B, C, D -- hasOne E, F, ---- hasAndBelongsToMany G, H > > I want to delete B, C, D, E, F, G, H and keep A 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 [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
