Closed spadefoot closed 12 years ago
The ORM can now create a "has many through" relation by adding the following metadata to a "has many" relation definition:
$this->relations = array(
...
'users_roles' => new DB_ORM_Relation_HasMany($this, array(
'parent_key' => array('uID'),
'through_model' => 'user_role',
'through_keys' => array(
array('uID'), // matches with parent
array('rID'), // matches with child
),
'child_model' => 'role',
'child_key' => array('rID'),
)),
...
);
It has been recommended that the LEAP ORM implement a many-to-many relation for handling such relationships. This would be in addition to the currently supported relations.