Howdy, I have created 2 DataObjects Rewards and Redemptions. I would like to display them on a single list sorted by their created field.
Here is the code doing the work;
function getRewardRedemptions() {
$doSet = new DataObjectSet();
if($Rewards = DataObject::get('Rewards',"MemberID={$this->Member->ID}")) {
$doSet->merge($Rewards);
}
if($this->Member && $Redemptions = DataObject::get('Redemptions',"MemberID={$this->Member->ID}")) {
$doSet->merge($Redemptions);
}
$doSet->Sort('Created');
return $doSet;
}
It all works a-ok with one small hick up the list is grouping the Objects. So all the rewards and the redemptions are sitting together. What I would like to happen is the rewards and redemptions to be intertwinned.
I'm pretty certain there is one little tweak I need to make so it all falls into place.
Any help would be greatly appreciated.