/**
* Generate the main thumbnails of a product
*
* @param bool $force Force to regenerate main thumbnails
*/
public function generateMainThumbnails(ProductModel
$article,
$force = false
) { $generator =
$this->
getContainer()->
get(Manager::
class);
$mediaService =
Shopware()->
Container()->
get(MediaServiceInterface::
class);
foreach ($article->
getImages() as $image) { $media =
$image->
getMedia();
$projectDir =
$this->
getContainer()->
getParameter('shopware.app.rootDir'
);
if (!\
is_string($projectDir)) { throw new RuntimeException('Parameter shopware.app.rootDir has to be a string'
);
} if (!
$force &&
$mediaService->
has($projectDir .
$media->
getPath())) { continue;
}