/**
* Resolves the passed configuratorOptions parameter for a single variant.
* Each passed configurator option, has to be configured in the product configurator set.
*
* @throws CustomValidationException
*
* @return array
*/
protected function prepareConfigurator(array
$data, ProductModel
$article, Detail
$variant) { if (!
$article->
getConfiguratorSet()) { throw new CustomValidationException('A configurator set has to be defined'
);
} $availableGroups =
$article->
getConfiguratorSet()->
getGroups();
$options =
new ArrayCollection();
foreach ($data['configuratorOptions'
] as $optionData) { $availableGroup =
$this->
getAvailableGroup($availableGroups,
[ 'id' =>
$optionData['groupId'
] ?? null,
'name' =>
$optionData['group'
] ?? null,
]);