/** @var PriceVariation $priceVariation */
$priceVariation =
new PriceVariation();
$data =
$this->
implodePriceVariation($data);
$priceVariation->
fromArray($data);
$modelManager =
$this->
get(\Shopware\Components\Model\ModelManager::
class);
/** @var Set|null $configuratorSet */
$configuratorSet =
$modelManager ->
getRepository(Set::
class) ->
find($data['configuratorSetId'
]);
$priceVariation->
setConfiguratorSet($configuratorSet);
$modelManager->
persist($priceVariation);
$modelManager->
flush();
$data['id'
] =
$priceVariation->
getId();
$data =
$this->
explodePriceVariation($data);
$this->
View()->
assign([ 'success' => true,
'data' =>
$data,
]);
}