public function manyToMany($accessor, $relationId, $foreignRelationId)
{
if ($r = $this->getRelation($relationId)) {
return $this->relations[$accessor] = new Relationship($accessor, array('type' => Relationship::MANY_TO_MANY, 'relation_junction' => $relationId, 'relation_foreign' => $foreignRelationId));
}
throw new Exception("Relation {$relationId} is not defined.");
}