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