Dumplie\Customer\Application\Command\AddToCart::quantity PHP Method

quantity() public method

public quantity ( ) : integer
return integer
    public function quantity() : int
    {
        return $this->quantity;
    }

Usage Example

示例#1
0
 /**
  * @param AddToCart $command
  *
  * @throws \Exception
  */
 public function handle(AddToCart $command)
 {
     $product = $this->products->getBySku(new SKU($command->sku()));
     $cart = $this->carts->getById(new CartId($command->cartId()));
     $cart->add($product, $command->quantity());
 }