original_string: public function update($table, array $data = null, $where = null)
      {
          $update = $this->build()->update($table);
          if ($data) {
              $update->set($data);
          }
          if ($where) {
              $update->where($where);
          }
          if ($data && $where) {
              return $update->execute();
          }
  
          return $update;
      }
code: public function update($table, array $data = null, $where = null)
      {
          $update = $this->build()->update($table);
          if ($data) {
              $update->set($data);
          }
          if ($where) {
              $update->where($where);
          }
          if ($data && $where) {
              return $update->execute();
          }
  
          return $update;
      }
code_tokens: public function update ( $ table , array $ data = null , $ where = null ) { $ update = $ this -> build ( ) -> update ( $ table ) ; if ( $ data ) { $ update -> set ( $ data ) ; } if ( $ where ) { $ update -> where ( $ where ) ; } if ( $ data && $ where ) { return $ update -> execute ( ) ; } return $ update ; }
docstring: Update data in a table
  
  When all parameters are specified, the update query is immediately
  executed and the number of rows affected will be returned. Otherwise
  the query builder is returned so you can extend the query further.
  
  @param string       $table
  @param array        $data  (optional)
  @param array|string $where (optional)
  @return Query|int
  @throws QueryException
docstring_tokens: Update data in a table