Say I wanted to get a dataobjectset of all articles in a given category based on the relationship defined in the classes below... what would be the nicest way to do that in a DataObject::get() call?
class Article extends DataObject{
static $many_many = array(
'Categories' => 'Category'
);
}
class Category extends DataObject{
static $belongs_many_many = array(
'Articles' => 'Article'
);
}
Currently I have just been doing a reverse lookup like
DataObject::get_one('Category', 'URLSegment = 'cheese')->Articles();
But that is not suitable in all cases