original_string: public function decorateResults($callback, $overwrite = false)
      {
          if ($overwrite) {
              $this->_resultDecorators = [];
          }
  
          if ($callback !== null) {
              $this->_resultDecorators[] = $callback;
          }
  
          return $this;
      }
code: public function decorateResults($callback, $overwrite = false)
      {
          if ($overwrite) {
              $this->_resultDecorators = [];
          }
  
          if ($callback !== null) {
              $this->_resultDecorators[] = $callback;
          }
  
          return $this;
      }
code_tokens: public function decorateResults ( $ callback , $ overwrite = false ) { if ( $ overwrite ) { $ this -> _resultDecorators = [ ] ; } if ( $ callback !== null ) { $ this -> _resultDecorators [ ] = $ callback ; } return $ this ; }
docstring: Registers a callback to be executed for each result that is fetched from the
  result set, the callback function will receive as first parameter an array with
  the raw data from the database for every row that is fetched and must return the
  row with any possible modifications.
  
  Callbacks will be executed lazily, if only 3 rows are fetched for database it will
  called 3 times, event though there might be more rows to be fetched in the cursor.
  
  Callbacks are stacked in the order they are registered, if you wish to reset the stack
  the call this function with the second parameter set to true.
  
  If you wish to remove all decorators from the stack, set the first parameter
  to null and the second to true.
  
  ### Example
  
  ```
  $query->decorateResults(function ($row) {
  $row['order_total'] = $row['subtotal'] + ($row['subtotal'] * $row['tax']);
  return $row;
  });
  ```
  
  @param callable|null $callback The callback to invoke when results are fetched.
  @param bool $overwrite Whether or not this should append or replace all existing decorators.
  @return $this
docstring_tokens: Registers a callback to be executed for each result that is fetched from the result set the callback function will receive as first parameter an array with the raw data from the database for every row that is fetched and must return the row with any possible modifications .