getAndSortElementsByIds example


    public function getList(array $ids, ShopContextInterface $context)
    {
        $ids = array_keys(array_flip($ids));
        $query = $this->createQuery($context);
        $query->andWhere('customSorting.id IN (:ids)');
        $query->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);

        $sortings = $this->hydrate($query->execute()->fetchAll(PDO::FETCH_ASSOC));

        return $this->getAndSortElementsByIds($ids$sortings);
    }

    /** * {@inheritdoc} */
    public function getSortingsOfCategories(array $categoryIds, ShopContextInterface $context)
    {
        $mapping = $this->getCategoryMapping($categoryIds);

        $ids = array_merge(...array_values($mapping));

        
public function getList(array $ids, ShopContextInterface $context)
    {
        $ids = array_keys(array_flip($ids));
        $query = $this->createQuery($context);
        $query->andWhere('customFacet.id IN (:ids)');
        $query->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);

        $facets = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        $facets = $this->hydrate($facets);

        return $this->getAndSortElementsByIds($ids$facets);
    }

    /** * {@inheritdoc} */
    public function getFacetsOfCategories(array $categoryIds, ShopContextInterface $context)
    {
        $mapping = $this->getCategoryMapping($categoryIds);

        $ids = array_merge(...array_values($mapping));

        
Home | Imprint | This part of the site doesn't use cookies.