original_string: public function formatTreeList(Query $query, array $options = [])
      {
          return $query->formatResults(function ($results) use ($options) {
              /* @var \Cake\Collection\CollectionTrait $results */
              $options += [
                  'keyPath' => $this->_getPrimaryKey(),
                  'valuePath' => $this->_table->getDisplayField(),
                  'spacer' => '_',
              ];
  
              return $results
                  ->listNested()
                  ->printer($options['valuePath'], $options['keyPath'], $options['spacer']);
          });
      }
code: public function formatTreeList(Query $query, array $options = [])
      {
          return $query->formatResults(function ($results) use ($options) {
              /* @var \Cake\Collection\CollectionTrait $results */
              $options += [
                  'keyPath' => $this->_getPrimaryKey(),
                  'valuePath' => $this->_table->getDisplayField(),
                  'spacer' => '_',
              ];
  
              return $results
                  ->listNested()
                  ->printer($options['valuePath'], $options['keyPath'], $options['spacer']);
          });
      }
code_tokens: public function formatTreeList ( Query $ query , array $ options = [ ] ) { return $ query -> formatResults ( function ( $ results ) use ( $ options ) { /* @var \Cake\Collection\CollectionTrait $results */ $ options += [ 'keyPath' => $ this -> _getPrimaryKey ( ) , 'valuePath' => $ this -> _table -> getDisplayField ( ) , 'spacer' => '_' , ] ; return $ results -> listNested ( ) -> printer ( $ options [ 'valuePath' ] , $ options [ 'keyPath' ] , $ options [ 'spacer' ] ) ; } ) ; }
docstring: Formats query as a flat list where the keys are the primary key for the table
  and the values are the display field for the table. Values are prefixed to visually
  indicate relative depth in the tree.
  
  ### Options
  
  - keyPath: A dot separated path to the field that will be the result array key, or a closure to
  return the key from the provided row.
  - valuePath: A dot separated path to the field that is the array's value, or a closure to
  return the value from the provided row.
  - spacer: A string to be used as prefix for denoting the depth in the tree for each item.
  
  @param \Cake\ORM\Query $query The query object to format.
  @param array $options Array of options as described above.
  @return \Cake\ORM\Query Augmented query.
docstring_tokens: Formats query as a flat list where the keys are the primary key for the table and the values are the display field for the table . Values are prefixed to visually indicate relative depth in the tree .