this may be a rookie question for CakePHP but here it goes
I design 3 models with associations:
‘Client’ hasMany ‘Invoice’ hasMany ‘Item’
So when we do a read from Client, it will automatically grab related Invoices.
What if we try to delete a Client, is there a way so that CakePHP will automatically delete all related entries in ‘Invoice’ and subsequently all related entries in ‘Item’ ?
Yes, if the association is declared as
dependent.See http://book.cakephp.org/view/1043/hasMany.