2.4 project! Hi, I have a page with a many to many relationship
static $many_many = array(
'Others' => 'Other', );
I have no problem getting the related data for page:
class MyPage_Controller extends Page_Controller {
function RelatedOthers() {
return $this->getManyManyComponents('Others');
}
}
but I am also displaying the last 10 MyPages on a "holder" page:
public function LatestPages($num=10) {
$latest = DataObject::get_one("MyHolderPage");
return ($latest) ? DataObject::get("MyPage", "ParentID = $latest->ID", "Date DESC", "", $num) : false;
}
This all works but I need to get "RelatedOthers" info for each of the 10 entries on the holder page. I'm sure you'll all think that's easy, but I am stuck. Any help gratefully recieved.