$variant =
$this->
get('models'
)->
getRepository(ProductVariant::
class)->
find($variantId);
if (!
$variant) { $this->
View()->
assign([ 'success' => false,
'message' =>
sprintf('Product variant by id %s not found',
$variantId),
]);
return;
} $esd =
new Esd();
$esd->
setArticleDetail($variant);
$this->
getManager()->
persist($esd);
$this->
getManager()->
flush();
$this->
View()->
assign([ 'success' => true,
]);
} /**
* Event listener function of the product backend module.
* Will be fired when the user saves ESD
*/