original_string: public function update($set = array())
      {
          if (is_array($set)) {
              $params = array();
              foreach ($set as $field => $param) {
                  $this->add('set', $field . ' = ?', true);
                  $params[] = $param;
              }
              $this->params = array_merge($params, $this->params);
          } else {
              $this->add('set', $set, true);
          }
          $this->type = self::UPDATE;
          return $this->execute();
      }
code: public function update($set = array())
      {
          if (is_array($set)) {
              $params = array();
              foreach ($set as $field => $param) {
                  $this->add('set', $field . ' = ?', true);
                  $params[] = $param;
              }
              $this->params = array_merge($params, $this->params);
          } else {
              $this->add('set', $set, true);
          }
          $this->type = self::UPDATE;
          return $this->execute();
      }
code_tokens: public function update ( $ set = array ( ) ) { if ( is_array ( $ set ) ) { $ params = array ( ) ; foreach ( $ set as $ field => $ param ) { $ this -> add ( 'set' , $ field . ' = ?' , true ) ; $ params [ ] = $ param ; } $ this -> params = array_merge ( $ params , $ this -> params ) ; } else { $ this -> add ( 'set' , $ set , true ) ; } $ this -> type = self :: UPDATE ; return $ this -> execute ( ) ; }
docstring: Execute a update query with specified data
  
  @param array|string $set
  @return int
docstring_tokens: Execute a update query with specified data