orderDeliveryNotFound example

$criteria = new Criteria([$orderDeliveryId]);
        $criteria->addAssociation('order.orderCustomer');
        $criteria->addAssociation('order.transactions.stateMachineState');

        /** @var OrderDeliveryEntity|null $orderDelivery */
        $orderDelivery = $this->deliveryRepository
            ->search($criteria$event->getContext())
            ->first();

        if ($orderDelivery === null) {
            throw OrderException::orderDeliveryNotFound($orderDeliveryId);
        }

        if ($orderDelivery->getOrder() === null) {
            throw OrderException::orderDeliveryNotFound($orderDeliveryId);
        }

        $context = $this->getContext($orderDelivery->getOrderId()$event->getContext());
        $order = $this->getOrder($orderDelivery->getOrderId()$context);

        $this->dispatchEvent($event->getStateEventName()$order$context);
    }

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