public function update($rawId, $attribute)
    {
        if (!$row = $this->get($rawId)) {
            throw new Exception('Item not found.');
        }

        $cart = $this->getCart();

        $this->event->fire('shopping_cart.updating', [$row, $cart]);

        if (is_array($attribute)) {
            $raw = $this->updateAttribute($rawId, $attribute);
        } else {
            $raw = $this->updateQty($rawId, $attribute);
        }

        $this->event->fire('shopping_cart.updated', [$row, $cart]);

        return $raw;
    }
public function update($rawId, $attribute)
    {
        if (!$row = $this->get($rawId)) {
            throw new Exception('Item not found.');
        }

        $cart = $this->getCart();

        $this->event->fire('shopping_cart.updating', [$row, $cart]);

        if (is_array($attribute)) {
            $raw = $this->updateAttribute($rawId, $attribute);
        } else {
            $raw = $this->updateQty($rawId, $attribute);
        }

        $this->event->fire('shopping_cart.updated', [$row, $cart]);

        return $raw;
    }
public function update ( $ rawId , $ attribute ) { if ( ! $ row = $ this -> get ( $ rawId ) ) { throw new Exception ( 'Item not found.' ) ; } $ cart = $ this -> getCart ( ) ; $ this -> event -> fire ( 'shopping_cart.updating' , [ $ row , $ cart ] ) ; if ( is_array ( $ attribute ) ) { $ raw = $ this -> updateAttribute ( $ rawId , $ attribute ) ; } else { $ raw = $ this -> updateQty ( $ rawId , $ attribute ) ; } $ this -> event -> fire ( 'shopping_cart.updated' , [ $ row , $ cart ] ) ; return $ raw ; }
Update the quantity of one row of the cart.

@param string    $rawId     The __raw_id of the item you want to update
@param int|array $attribute New quantity of the item|Array of attributes to update

@return Item|bool
Update the quantity of one row of the cart .