Hi,
You don't need to define a dependency for this, RedBeanPHP cleans link tables automatically because the records themselves are
meaningless. Dependencies are only meant for N-1 relations.
Cheers,
Gabor
On Saturday, November 10, 2012 12:04:31 AM UTC+1, cslinuxboy wrote:
I am using shared lists (many-many relationship) and would like to create dependencies to take advantage of cascading deletes. But I don't know if I'm doing things correct. I have three tables; Watches, Events, and Events_Watches. There is a many-many relationship between the Watches and Events (Watches can have many Events). Therefore, RB created the Events_Watches table for me via the sharedEvents variable for a Watches bean. So how would I construct the dependency?
Would it be
R::dependencies(array(Events_Watches=>array(Watches)) ?
or
R::dependencies(array(Events=>array(Watches)) ?
I want RB to cascade delete the records out of the Events_Watches table when I trash() a Watch that has events associated with it. Many thanks.
Mike