Hey all,
I'm new to silverstripe and trying to combine two dataobjects into an ArrayList and then sort it by Date/Created but It doesn't do the sort. I've included the code below.
$displayContent = ArrayList::create();
$projectPages = ProjectPage::get()->sort('Created', 'DESC');
$blogPages = BlogEntry::get()->sort('Created');
foreach ($projectPages as $projectPage) {
$displayContent->merge($projectPage);
}
foreach ($blogPages as $blogPage) {
$displayContent->merge($blogPage);
}
$displayContent->sort('Created');
return $displayContent;
Thanks for any help
David