if ($shopId !== null
) { $builder->
andWhere('(blog.shopIds LIKE :shopId OR blog.shopIds IS NULL)'
) ->
setParameter('shopId', '%|' .
$shopId . '|%'
);
} if (!
empty($blogCategoryIds)) { $builder->
andWhere('blog.categoryId IN (:categoryIds)'
) ->
setParameter('categoryIds',
$blogCategoryIds, Connection::PARAM_INT_ARRAY
);
} if ($shopId &&
Shopware()->
Config()->
get('displayOnlySubShopBlogComments'
)) { $builder ->
leftJoin('blog.comments', 'comments', Join::WITH, 'comments.active = 1 AND (comments.shopId IS NULL OR comments.shopId = :commentShopId)'
) ->
setParameter('commentShopId',
$shopId);
} else { $builder->
leftJoin('blog.comments', 'comments', Join::WITH, 'comments.active = 1'
);
} if (!
empty($filter)) { $builder->
addFilter($filter);
}