private function getManufacturerIdsByCategoryId(int
$categoryId, ShopContextInterface
$context): array
{ $builder =
$this->connection->
createQueryBuilder();
$builder->
select('manufacturer.id'
) ->
from('s_articles', 'article'
) ->
innerJoin('article', 's_articles_categories_ro', 'article_cat_ro', 'article_cat_ro.articleID = article.id AND article_cat_ro.categoryID = :categoryId'
) ->
innerJoin('article_cat_ro', 's_categories', 'category', 'category.id = article_cat_ro.categoryID AND category.active = 1'
) ->
innerJoin('article', 's_articles_supplier', 'manufacturer', 'article.supplierID = manufacturer.id'
) ->
leftJoin('article', 's_articles_avoid_customergroups', 'article_avoid_group', 'article.id = article_avoid_group.articleID AND article_avoid_group.customergroupID = :customerGroupId'
) ->
where('article.active = 1'
) ->
andWhere('article_avoid_group.articleID IS NULL'
) ->
groupBy('manufacturer.id'
) ->
orderBy('manufacturer.name'
) ->
setMaxResults(12
) ->
setParameter('categoryId',
$categoryId) ->
setParameter('customerGroupId',
$context->
getCurrentCustomerGroup()->
getId()) ;
return $builder->
execute()->
fetchAll(PDO::FETCH_COLUMN
);
}}