It appears I have imagined a problem where there was none. I have just tested creating and deleting a Trainer:
User hasOne Trainer
dependent => true
InnoDB relation in trainers table with delete = RESTRICT
Trainer hasMany CourseTrainer
dependent => true
InnoDB relation in course_trainers table with delete = RESTRICT
When deleting the trainer I call $this->Trainer->User->delete(); and it cascades down deleting records across all 3 tables.
My issue was I mistakenly had dependent => false for the Trainer hasMany CourseTrainer relation.
Silly me.
-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment