Dumplie\CustomerService\Infrastructure\InMemory\InMemoryOrders::getById PHP Method

getById() public method

public getById ( OrderId $orderId ) : Dumplie\CustomerService\Domain\Order
$orderId Dumplie\CustomerService\Domain\OrderId
return Dumplie\CustomerService\Domain\Order
    public function getById(OrderId $orderId) : Order
    {
        if (!array_key_exists((string) $orderId, $this->orders)) {
            throw OrderNotFoundException::byId($orderId);
        }
        return $this->orders[(string) $orderId];
    }