示例#1
0
 /**
  * Adds cartLine to Cart.
  *
  * This method dispatches all Cart Check and Load events
  * It should NOT be used to add a Purchasable to a Cart,
  * by manually passing a newly crafted CartLine, since
  * no product duplication check is performed: in that
  * case CartManager::addProduct should be used
  *
  * @param CartInterface     $cart     Cart
  * @param CartLineInterface $cartLine Cart line
  *
  * @return $this Self object
  */
 private function addLine(CartInterface $cart, CartLineInterface $cartLine)
 {
     $cartLine->setCart($cart);
     $cart->addCartLine($cartLine);
     $this->cartLineEventDispatcher->dispatchCartLineOnAddEvent($cart, $cartLine);
     $this->cartEventDispatcher->dispatchCartLoadEvents($cart);
     return $this;
 }