original_string: protected function prepareResults(array &$results, array $options)
      {
          $reindexed = array();
  
          foreach ($results as &$result) {
              $this->prepareResult($result, $options);
              if (!empty($options['index'])) {
                  $reindexed[$result[$options['index']]] = $result;
              }
          }
  
          if (!empty($options['index'])) {
              $results = $reindexed;
          }
      }
code: protected function prepareResults(array &$results, array $options)
      {
          $reindexed = array();
  
          foreach ($results as &$result) {
              $this->prepareResult($result, $options);
              if (!empty($options['index'])) {
                  $reindexed[$result[$options['index']]] = $result;
              }
          }
  
          if (!empty($options['index'])) {
              $results = $reindexed;
          }
      }
code_tokens: protected function prepareResults ( array & $ results , array $ options ) { $ reindexed = array ( ) ; foreach ( $ results as & $ result ) { $ this -> prepareResult ( $ result , $ options ) ; if ( ! empty ( $ options [ 'index' ] ) ) { $ reindexed [ $ result [ $ options [ 'index' ] ] ] = $ result ; } } if ( ! empty ( $ options [ 'index' ] ) ) { $ results = $ reindexed ; } }
docstring: Prepares an array of results
  @param array $results
  @param array $options
docstring_tokens: Prepares an array of results