getFallbackQuery example


    public function loadEsdOfCustomer(int $customerId, int $esdId): Esd
    {
        $query = $this->getDefaultQuery()
            ->setParameter('customerId', $customerId)
            ->setParameter('esdId', $esdId);

        $result = $query->execute()->fetch();

        if (empty($result)) {
            $query = $this->getFallbackQuery()
                ->setParameter('customerId', $customerId)
                ->setParameter('esdId', $esdId);

            $result = $query->execute()->fetch();
        }

        if (empty($result)) {
            throw new EsdNotFoundException();
        }

        return $this->esdHydrator->hydrate($result);
    }
Home | Imprint | This part of the site doesn't use cookies.