$option =
$this->
get('models'
)->
getReference(Option::
class,
$ruleData['optionId'
]);
$rule->
setMapping($mapping);
$rule->
setOption($option);
$mapping->
getRules()->
add($rule);
$options[] =
$option;
} $mapping->
setImage($image);
$this->
get('models'
)->
persist($mapping);
$this->
createImagesForOptions($options,
$imageData,
$image);
$mappingModels[] =
$mapping;
} $image->
setMappings($mappingModels);
$this->
get('models'
)->
persist($image);
$this->
get('models'
)->
flush();
$result =
$this->
getRepository()->
getArticleImageQuery($imageId)->
getArrayResult();
$this->
View()->
assign(['success' => true, 'data' =>
$result]);
} /**
* Event listener function of the product backend module. Fired when the user
* edit or create an product variant and clicks the save button which displayed on bottom of the product
* variant detail window.
*/