Sonata\PaymentBundle\Consumer\PaymentProcessOrderConsumer::getOrder PHP Method

getOrder() protected method

Get the related Order.
protected getOrder ( Sonata\NotificationBundle\Consumer\ConsumerEvent $event ) : Sonata\Component\Order\OrderInterface
$event Sonata\NotificationBundle\Consumer\ConsumerEvent
return Sonata\Component\Order\OrderInterface
    protected function getOrder(ConsumerEvent $event)
    {
        $orderId = $event->getMessage()->getValue('order_id');
        $order = $this->orderManager->getOrder($orderId);
        if (!$order) {
            throw new \RuntimeException(sprintf('Unable to retrieve Order %d', $orderId));
        }
        return $order;
    }