Wie schaffe ich es, dass die Media Daten von den Images von diesem Query nicht null sind?
$builder = $this->getEntityManager()->createQueryBuilder();
$builder->select([
'variants',
'attribute',
'prices',
'customerGroup',
'options',
'images',
]);
$builder->from('Shopware\Models\Article\Detail', 'variants')
->innerJoin('variants.article', 'article')
->leftJoin('variants.attribute', 'attribute')
->leftJoin('variants.images', 'images')
->leftJoin('variants.prices', 'prices')
->innerJoin('prices.customerGroup', 'customerGroup')
->leftJoin('variants.configuratorOptions', 'options');
$builder->andWhere('article.id = :articleId')
->andWhere('variants.kind = 2')
->leftJoin('options.attribute', 'optionsAttribute')
->leftJoin('images.media', 'imagesMedia')
->addSelect('optionsAttribute')
->addSelect('imagesMedia')
->setParameter('articleId', (int)$articleId);
$builder->getQuery()->getArrayResult()