if (!
$config) { $collection->
sortByPositions();
return $collection;
} $sortedGroupIds =
array_column($config, 'id'
);
// ensure all ids are in the array (but only once)
$sortedGroupIds =
array_unique(array_merge($sortedGroupIds,
$collection->
getIds()));
$collection->
sortByIdArray($sortedGroupIds);
return $collection;
} /**
* @param array<string> $current
*/
private function isCombinable( PropertyGroupOptionEntity
$option,
array
$current,
AvailableCombinationResult
$combinations ):