/**
* {@inheritdoc}
*/
public function findByIds($ids)
{
if (count($ids) === 0) {
return [];
}
$parsed = $this->converter->convertIdsToGroupedIds($ids, ['a' => [], 'c' => []]);
$accounts = $this->findAccountsByIds($parsed['a']);
$contacts = $this->findContactsByIds($parsed['c']);
$result = array_merge($accounts, $contacts);
// the @ is necessary in case of a PHP bug https://bugs.php.net/bug.php?id=50688
@usort($result, function ($a, $b) use($ids) {
return $this->comparator->compare($a['id'], $b['id'], $ids);
});
return $result;
}