byCartId() public static method

public static byCartId ( CartId $cartId ) : CheckoutNotFoundException
$cartId Dumplie\Customer\Domain\CartId
return CheckoutNotFoundException
コード例 #1
0
ファイル: ORMCheckouts.php プロジェクト: dumplie/dumplie
 /**
  * @param CartId $cartId
  * @return Checkout
  * @throws CheckoutNotFoundException
  */
 public function getForCart(CartId $cartId) : Checkout
 {
     $checkout = $this->entityManager->getRepository(Checkout::class)->findOneBy(['cartId.id' => $cartId]);
     if (is_null($checkout)) {
         throw CheckoutNotFoundException::byCartId($cartId);
     }
     return $checkout;
 }