original_string: public function findPath(Query $query, array $options)
      {
          if (empty($options['for'])) {
              throw new InvalidArgumentException("The 'for' key is required for find('path')");
          }
  
          $config = $this->getConfig();
          list($left, $right) = array_map(
              function ($field) {
                  return $this->_table->aliasField($field);
              },
              [$config['left'], $config['right']]
          );
  
          $node = $this->_table->get($options['for'], ['fields' => [$left, $right]]);
  
          return $this->_scope($query)
              ->where([
                  "$left <=" => $node->get($config['left']),
                  "$right >=" => $node->get($config['right']),
              ])
              ->order([$left => 'ASC']);
      }
code: public function findPath(Query $query, array $options)
      {
          if (empty($options['for'])) {
              throw new InvalidArgumentException("The 'for' key is required for find('path')");
          }
  
          $config = $this->getConfig();
          list($left, $right) = array_map(
              function ($field) {
                  return $this->_table->aliasField($field);
              },
              [$config['left'], $config['right']]
          );
  
          $node = $this->_table->get($options['for'], ['fields' => [$left, $right]]);
  
          return $this->_scope($query)
              ->where([
                  "$left <=" => $node->get($config['left']),
                  "$right >=" => $node->get($config['right']),
              ])
              ->order([$left => 'ASC']);
      }
code_tokens: public function findPath ( Query $ query , array $ options ) { if ( empty ( $ options [ 'for' ] ) ) { throw new InvalidArgumentException ( "The 'for' key is required for find('path')" ) ; } $ config = $ this -> getConfig ( ) ; list ( $ left , $ right ) = array_map ( function ( $ field ) { return $ this -> _table -> aliasField ( $ field ) ; } , [ $ config [ 'left' ] , $ config [ 'right' ] ] ) ; $ node = $ this -> _table -> get ( $ options [ 'for' ] , [ 'fields' => [ $ left , $ right ] ] ) ; return $ this -> _scope ( $ query ) -> where ( [ "$left <=" => $ node -> get ( $ config [ 'left' ] ) , "$right >=" => $ node -> get ( $ config [ 'right' ] ) , ] ) -> order ( [ $ left => 'ASC' ] ) ; }
docstring: Custom finder method which can be used to return the list of nodes from the root
  to a specific node in the tree. This custom finder requires that the key 'for'
  is passed in the options containing the id of the node to get its path for.
  
  @param \Cake\ORM\Query $query The constructed query to modify
  @param array $options the list of options for the query
  @return \Cake\ORM\Query
  @throws \InvalidArgumentException If the 'for' key is missing in options
docstring_tokens: Custom finder method which can be used to return the list of nodes from the root to a specific node in the tree . This custom finder requires that the key for is passed in the options containing the id of the node to get its path for .