public function __construct(Connection
$connection, VariantHelperInterface
$variantHelper) { $this->connection =
$connection;
$this->variantHelper =
$variantHelper;
} /**
* {@inheritdoc}
*/
public function createCategoryQuery($categoryId,
$limit = null
) { if (!
$this->variantHelper->
getVariantFacet()) { $query =
$this->connection->
createQueryBuilder() ->
select(['categories.articleID', 'categories.articleID'
]) ->
from('s_articles_categories_ro', 'categories'
) ->
andWhere('categories.articleID > :lastId'
) ->
andWhere('categories.categoryID = :categoryId'
) ->
setParameter(':categoryId',
$categoryId, PDO::PARAM_INT
) ->
setParameter(':lastId', 0, PDO::PARAM_INT
) ->
orderBy('categories.articleID'
);
if ($limit !== null
) { $query->
setMaxResults($limit);
}