} /**
* This method generates all variant image entities for a given product model instance.
* The method expects that the variants and the mapping of the product images already exist.
*
* @param bool $force Force variant image regeneration
*/
public function generateVariantImages(ProductModel
$article,
$force = false
) { $builder =
$this->
getArticleImageMappingsQuery($article->
getId());
foreach ($builder->
getQuery()->
getResult() as $mapping) { $builder =
$this->
getArticleVariantQuery($article->
getId());
foreach ($mapping->
getRules() as $rule) { $option =
$rule->
getOption();
$alias = 'option' .
$option->
getId();
$builder->
innerJoin('variants.configuratorOptions',
$alias, 'WITH',
$alias . '.id = :' .
$alias) ->
setParameter($alias,
$option->
getId());
}