Im having a bit of a hard time working out the best way to structure what I think is a $many_many relationship. I have a Business class and an Event class. Businesses can be associated with multiple Events, and Events can be associated with multiple Businesses.
What Im not sure of is which is the correct class to put the $many_many, and which is the correct class to put the $belongs_many_many? It almost seems as if BOTH classes need a $many_many AND a $belongs_many_many? Is that the correct way to approach it?
maybe it is like the documentation says... http://doc.silverstripe.org/recipes:many_many-example
// Defines the join in the referenced class as $belongs_many_many.
// a new table, (this-class)_(relationship-name), will be created with a pair of ID fields.
static $belongs_many_many = array('Articles' => 'Article'
// an Article can have many Category objects associated with it.
// calling $this->getManyManyComponents('Categories') retrieves the associated Category objects.
static $many_many = array('Categories' => 'Category'
I can't remember whether I've ever had trouble doing ->RelationshipName() on either of the two sides... or if it has affected how is appears when scaffolded with modeladmin... but you can try it out and see... those are the things I'd test to see if there was a difference.