Hi,
I have a Many to Many relation between myPage and myDataObject.
In the frontend I would like to sort the output descending on date LastEdited (instead of the default ascending on ID).
I'm afraid I have to use joins, but I don have any experience with that...
Could someone help me out?
Some code of what I'm trying:
class myPage extends Page{
static $many_many = array (
'myDataObject' => 'myDataObject'
);
}
class myPage_Controller extends Page_Controller{
function MyObject(){
$myobject=DataObject::get('myDataObject',.......?.......,'LastEdited DESC');
return $myobject;
}}
class myDataObject extends DataObject{
static $belongs_many_many = array(
'myPage'=>'myPage'
);
}