Dear all,
I have a function "MyFunction" from where I can call two different objects. Each on its own work fine, I get either "Result A" or "Result B". Both getManyManyComponents() from both DataObject::get are calling the same class.
So Result A and result B have a common subset of results. Is there a simple way to combine two DataObject::get?
Thank for your help
class DoResults_Controller extends Page_Controller {
function MyFunction(){
....
//$result = DataObject::get("TheOneObject","TheOneFilter");//Result A
$result = DataObject::get("TheOtherObject","TheOtherFilter");//Result B
return $result;
}
...
}
class TheOneObject extends DataObject {
....
static $belongs_many_many = array(
'Topics' => 'Topic'
);
function GetThisOne(){
return $this->getManyManyComponents("Topics");
}
}
class TheOtherObject extends DataObject {
....
static $belongs_many_many = array(
'Topics' => 'Topic'
);
function GetTheOtherOne(){
return $this->getManyManyComponents("Topics");
}
}