original_string: public function update($cart_id, array $data)
      {
          $result = null;
          $this->hook->attach('cart.update.before', $cart_id, $data, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          $data['modified'] = GC_TIME;
          $result = (bool) $this->db->update('cart', $data, array('cart_id' => $cart_id));
  
          gplcart_static_clear();
  
          $this->hook->attach('cart.update.after', $cart_id, $data, $result, $this);
          return (bool) $result;
      }
code: public function update($cart_id, array $data)
      {
          $result = null;
          $this->hook->attach('cart.update.before', $cart_id, $data, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          $data['modified'] = GC_TIME;
          $result = (bool) $this->db->update('cart', $data, array('cart_id' => $cart_id));
  
          gplcart_static_clear();
  
          $this->hook->attach('cart.update.after', $cart_id, $data, $result, $this);
          return (bool) $result;
      }
code_tokens: public function update ( $ cart_id , array $ data ) { $ result = null ; $ this -> hook -> attach ( 'cart.update.before' , $ cart_id , $ data , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( bool ) $ result ; } $ data [ 'modified' ] = GC_TIME ; $ result = ( bool ) $ this -> db -> update ( 'cart' , $ data , array ( 'cart_id' => $ cart_id ) ) ; gplcart_static_clear ( ) ; $ this -> hook -> attach ( 'cart.update.after' , $ cart_id , $ data , $ result , $ this ) ; return ( bool ) $ result ; }
docstring: Updates a cart
  @param integer $cart_id
  @param array $data
  @return boolean
docstring_tokens: Updates a cart