Inheritance: implements Dumplie\SharedKernel\Application\Command\Command, use trait Dumplie\SharedKernel\Application\Command\CommandSerialize
コード例 #1
0
ファイル: AddToCartHandler.php プロジェクト: dumplie/dumplie
 /**
  * @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());
 }