Commit 3a86b753 authored by Bernhard Schussek's avatar Bernhard Schussek

Merge branch 'bugfix/id-sorting' into 'master'

Fixed getMultiple() when ordering by ID

See merge request !6
parents 219e681a d7fdad71
......@@ -147,7 +147,13 @@ abstract class ORMRepository extends EntityRepository implements EditableReposit
->execute();
// Maintain the order of IDs
$sortedAggregates = array_replace(array_flip($idStrings), $aggregates);
$sortedAggregates = [];
foreach ($ids as $id) {
if (isset($aggregates[$id->toString()])) {
$sortedAggregates[$id->toString()] = $aggregates[$id->toString()];
}
}
$cursor = new ArrayCursor($sortedAggregates);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment