createStateQuery example



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

        $query = $this->createStateQuery($context);

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

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

        $states = [];
        foreach ($data as $row) {
            $state = $this->countryHydrator->hydrateState($row);
            $states[$state->getId()] = $state;
        }

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