I have a many to many relationship and am wondering how I add new relationships. I've read quite a bit about how to query them but cannot find any help on how you add to the relationships, ie: these are Product and Member objects and Members can buy products. How do you add the new relationship.
Is it as simple as just adding an entry to the intermediate array with the two keys or is there a better way.
Also, when have a Product instance, how can I find out if there is a related Member. Do I have to search the $product->BoughtBy array (this works but seems to be a clumsy way of doing it).
The first model class, Member, has the following relationship array:
The other model class, Product, has this relationship array:
and the relationship class has this relationship array: