// current id was mapped to another variant
if (!
$entities->
has($mapping[$id])) { continue;
} /** @var Entity $entity */
$entity =
$entities->
get($mapping[$id]);
// get access to the data of the search result
$entity->
addExtension('search',
new ArrayEntity($ids->
getDataOfId($id)));
} }}