sortByIds example

->where('countryArea.id IN (:ids)')
            ->setParameter(':ids', $ids, Connection::PARAM_INT_ARRAY);

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

        $areas = [];
        foreach ($data as $row) {
            $area = $this->countryHydrator->hydrateArea($row);
            $areas[$area->getId()] = $area;
        }

        return $this->sortByIds($ids$areas);
    }

    /** * {@inheritdoc} */
    public function getCountries(array $ids, ShopContextInterface $context)
    {
        if (empty($ids)) {
            return [];
        }

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