I would like to get the ten most recent entries between two entities (post, news).
In my controller:
$posts = $em->getRepository('AcmePostBundle:Post')->getTenLatest();
$news = $em->getRepository('AcmeNewsBundle:News')->getTenLatest();
How do I merge the two results? Something like:
$latest = $posts->merge($news);
And then, sort them by a date field, limit 10?
I was able to compare the dates of posts and news and add the newest to a new array. Then send the new array to the rss feed bundle.