foreach ($results as $combination) { $results[] =
array_merge([$element],
$combination);
} } return array_filter($results);
} private function createSplitting(array
$groups, array
$availability, VariantFacet
$facet): array
{ $consider =
array_filter($groups,
function DGroup
$group) use ($facet) { return \
in_array($group->
getId(),
$facet->
getExpandGroupIds(), true
);
});
$c = self::
arrayCombinations(array_keys($consider));
// Flip keys for later intersection
$keys =
array_flip(array_keys($consider));
$result =
[];
foreach ($c as $combination) { // Flip combination to use key intersect
$combination =
array_flip($combination);