byId() public static method

public static byId ( OrderId $orderId ) : OrderNotFoundException
$orderId Dumplie\CustomerService\Domain\OrderId
return OrderNotFoundException
Beispiel #1
0
 /**
 * @param OrderId $orderId
 *
 *@return Order
 * @throws OrderNotFoundException
 */
 public function getById(OrderId $orderId) : Order
 {
     if (!array_key_exists((string) $orderId, $this->orders)) {
         throw OrderNotFoundException::byId($orderId);
     }
     return $this->orders[(string) $orderId];
 }