public function editCartLine(
        CartLineInterface $cartLine,
        PurchasableInterface $purchasable,
        $quantity
    ) {
        $cart = $cartLine->getCart();

        if (!($cart instanceof CartInterface)) {
            return $this;
        }

        $cartLine->setPurchasable($purchasable);
        $this->setCartLineQuantity($cartLine, $quantity);

        return $this;
    }
public function editCartLine(
        CartLineInterface $cartLine,
        PurchasableInterface $purchasable,
        $quantity
    ) {
        $cart = $cartLine->getCart();

        if (!($cart instanceof CartInterface)) {
            return $this;
        }

        $cartLine->setPurchasable($purchasable);
        $this->setCartLineQuantity($cartLine, $quantity);

        return $this;
    }
public function editCartLine ( CartLineInterface $ cartLine , PurchasableInterface $ purchasable , $ quantity ) { $ cart = $ cartLine -> getCart ( ) ; if ( ! ( $ cart instanceof CartInterface ) ) { return $ this ; } $ cartLine -> setPurchasable ( $ purchasable ) ; $ this -> setCartLineQuantity ( $ cartLine , $ quantity ) ; return $ this ; }
Edit CartLine.

The line is updated only if it belongs to a Cart

This method dispatches all Cart Check and Load events

@param CartLineInterface    $cartLine    Cart line
@param PurchasableInterface $purchasable purchasable to be edited
@param int                  $quantity    item quantity

@return $this Self object
Edit CartLine .