getById() public method

public getById ( OrderId $orderId ) : Order
$orderId OrderId
return Order
Ejemplo n.º 1
0
 /**
  * @param AcceptOrder $command
  * @throws OrderNotFoundException
  * @throws InvalidTransitionException
  */
 public function handle(AcceptOrder $command)
 {
     $order = $this->orders->getById(new OrderId($command->orderId()));
     $order->accept();
 }
Ejemplo n.º 2
0
 /**
  * @param CreatePayment $command
  * @throws OrderNotFoundException
  */
 public function handle(CreatePayment $command)
 {
     $order = $this->orders->getById(new OrderId($command->orderId()));
     $this->payments->add(new Payment(new PaymentId($command->paymentId()), $order));
 }
Ejemplo n.º 3
0
 /**
  * @param RefundOrder $command
  * @throws InvalidTransitionException
  * @throws OrderNotFoundException
  */
 public function handle(RefundOrder $command)
 {
     $order = $this->orders->getById(new OrderId($command->orderId()));
     $order->refund();
 }
Ejemplo n.º 4
0
 /**
  * @param PrepareOrder $command
  * @throws InvalidTransitionException
  */
 public function handle(PrepareOrder $command)
 {
     $order = $this->orders->getById(new OrderId($command->orderId()));
     $order->prepare();
 }