public function removeItem($item)
    {
        if (!$item instanceof LineItem) {
            throw new ValidationException(_t(
                "ShoppingCart.WrongItemClass",
                "Item needs to be of class {class}",
                ["class" => LineItem::class]
            ));
        }

        $item->delete();
        $this->save();

        return $this;
    }
public function removeItem($item)
    {
        if (!$item instanceof LineItem) {
            throw new ValidationException(_t(
                "ShoppingCart.WrongItemClass",
                "Item needs to be of class {class}",
                ["class" => LineItem::class]
            ));
        }

        $item->delete();
        $this->save();

        return $this;
    }
public function removeItem ( $ item ) { if ( ! $ item instanceof LineItem ) { throw new ValidationException ( _t ( "ShoppingCart.WrongItemClass" , "Item needs to be of class {class}" , [ "class" => LineItem :: class ] ) ) ; } $ item -> delete ( ) ; $ this -> save ( ) ; return $ this ; }
Remove a LineItem from ShoppingCart

@param LineItem $item The item to remove

@return self
Remove a LineItem from ShoppingCart