Dumplie\Customer\Domain\Exception\CartNotFoundException::byId PHP Method

byId() public static method

public static byId ( CartId $cartId ) : CartNotFoundException
$cartId Dumplie\Customer\Domain\CartId
return CartNotFoundException
    public static function byId(CartId $cartId) : CartNotFoundException
    {
        return new self(sprintf('Cart with id "%s" does not exists.', (string) $cartId));
    }

Usage Example

Example #1
0
 /**
  * @param CartId $cartId
  *
  * @throws CartNotFoundException
  */
 public function remove(CartId $cartId)
 {
     if (!$this->exists($cartId)) {
         throw CartNotFoundException::byId($cartId);
     }
     unset($this->carts[(string) $cartId]);
 }
All Usage Examples Of Dumplie\Customer\Domain\Exception\CartNotFoundException::byId
CartNotFoundException