Deleting from multiple models

2009-01-03 Thread rhythmicde...@gmail.com
I have a model Recipe that has a one to many relationship with a model IngredientList I want to delete a single recipe from the Recipe model which should also delete all the records from the IngredientList model that have the recipe's ID. I would have thought that there would be a single line

Re: Deleting from multiple models

2009-01-03 Thread Alexandru
yes it is. check http://book.cakephp.org/view/80/hasOne for dependent key dependent: When the dependent key is set to true, and the model’s delete() method is called with the cascade parameter set to true, associated model records are also deleted. In this case we set it true so that deleting a

RE: Deleting from multiple models

2009-01-03 Thread Steven Wright
Thank you. -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Alexandru Sent: Saturday, January 03, 2009 7:42 PM To: CakePHP Subject: Re: Deleting from multiple models yes it is. check http://book.cakephp.org/view/80/hasOne