/**
* @param array[] $data
* @param int[] $optionIds
*
* @return Group[]
*/
private function hydrateProperties(array
$data, array
$optionIds): array
{ $groups =
[];
foreach ($data as $row) { $group =
$this->hydrator->
createPropertyGroup($row['_source'
]);
$options =
array_filter($group->
getOptions(),
static function DOption
$option) use ($optionIds) { return \
in_array($option->
getId(),
$optionIds);
});
usort($options,
static function DOption
$a, Option
$b) { if ($a->
getPosition() !==
$b->
getPosition()) { return $a->
getPosition() <=>
$b->
getPosition();
} return $a->
getName() <=>
$b->
getName();
});