# The RecursiveTreeIterator class

(PHP 5 >= 5.3.0, PHP 7)

## Introduction

Allows iterating over a RecursiveIterator to generate an ASCII graphic tree.

## Class synopsis

RecursiveTreeIterator extends RecursiveIteratorIterator implements OuterIterator {
/* Inherited constants */
const int RecursiveIteratorIterator::LEAVES_ONLY = 0 ;
const int RecursiveIteratorIterator::SELF_FIRST = 1 ;
const int RecursiveIteratorIterator::CHILD_FIRST = 2 ;
const int RecursiveIteratorIterator::CATCH_GET_CHILD = 16 ;
/* Constants */
const int BYPASS_CURRENT = 4 ;
const int BYPASS_KEY = 8 ;
const int PREFIX_LEFT = 0 ;
const int PREFIX_MID_HAS_NEXT = 1 ;
const int PREFIX_MID_LAST = 2 ;
const int PREFIX_END_HAS_NEXT = 3 ;
const int PREFIX_END_LAST = 4 ;
const int PREFIX_RIGHT = 5 ;
/* Methods */
public beginChildren ( ) : void
public beginIteration ( ) : RecursiveIterator
public callGetChildren ( ) : RecursiveIterator
public callHasChildren ( ) : bool
public __construct ( RecursiveIterator|IteratorAggregate `$it` [, int `$flags` = RecursiveTreeIterator::BYPASS_KEY [, int `$cit_flags` = CachingIterator::CATCH_GET_CHILD [, int `$mode` = RecursiveIteratorIterator::SELF_FIRST ]]] )
public current ( ) : string
public endChildren ( ) : void
public endIteration ( ) : void
public getEntry ( ) : string
public getPostfix ( ) : string
public getPrefix ( ) : string
public key ( ) : string
public next ( ) : void
public nextElement ( ) : void
public rewind ( ) : void
public setPostfix ( string `$postfix` ) : void
public setPrefixPart ( int `$part` , string `$value` ) : void
public valid ( ) : bool
/* Inherited methods */
public RecursiveIteratorIterator::beginChildren ( ) : void
public RecursiveIteratorIterator::beginIteration ( ) : void
public RecursiveIteratorIterator::callGetChildren ( ) : RecursiveIterator
public RecursiveIteratorIterator::callHasChildren ( ) : bool
public RecursiveIteratorIterator::__construct ( Traversable `$iterator` [, int `$mode` = RecursiveIteratorIterator::LEAVES_ONLY [, int `$flags` = 0 ]] )
public RecursiveIteratorIterator::current ( ) : mixed
public RecursiveIteratorIterator::endChildren ( ) : void
public RecursiveIteratorIterator::endIteration ( ) : void
public RecursiveIteratorIterator::getDepth ( ) : int
public RecursiveIteratorIterator::getInnerIterator ( ) : iterator
public RecursiveIteratorIterator::getMaxDepth ( ) : mixed
public RecursiveIteratorIterator::getSubIterator ([ int `$level` ] ) : RecursiveIterator
public RecursiveIteratorIterator::key ( ) : mixed
public RecursiveIteratorIterator::next ( ) : void
public RecursiveIteratorIterator::nextElement ( ) : void
public RecursiveIteratorIterator::rewind ( ) : void
public RecursiveIteratorIterator::setMaxDepth ([ int `$max_depth` = -1 ] ) : void
public RecursiveIteratorIterator::valid ( ) : bool
}

## Predefined Constants

`RecursiveTreeIterator::BYPASS_CURRENT`

`RecursiveTreeIterator::BYPASS_KEY`

`RecursiveTreeIterator::PREFIX_LEFT`

`RecursiveTreeIterator::PREFIX_MID_HAS_NEXT`

`RecursiveTreeIterator::PREFIX_MID_LAST`

`RecursiveTreeIterator::PREFIX_END_HAS_NEXT`

`RecursiveTreeIterator::PREFIX_END_LAST`

`RecursiveTreeIterator::PREFIX_RIGHT`

## Table of Contents

- RecursiveTreeIterator::beginChildren — Begin children
- RecursiveTreeIterator::beginIteration — Begin iteration
- RecursiveTreeIterator::callGetChildren — Get children
- RecursiveTreeIterator::callHasChildren — Has children
- RecursiveTreeIterator::__construct — Construct a RecursiveTreeIterator
- RecursiveTreeIterator::current — Get current element
- RecursiveTreeIterator::endChildren — End children
- RecursiveTreeIterator::endIteration — End iteration
- RecursiveTreeIterator::getEntry — Get current entry
- RecursiveTreeIterator::getPostfix — Get the postfix
- RecursiveTreeIterator::getPrefix — Get the prefix
- RecursiveTreeIterator::key — Get the key of the current element
- RecursiveTreeIterator::next — Move to next element
- RecursiveTreeIterator::nextElement — Next element
- RecursiveTreeIterator::rewind — Rewind iterator
- RecursiveTreeIterator::setPostfix — Set postfix
- RecursiveTreeIterator::setPrefixPart — Set a part of the prefix
- RecursiveTreeIterator::valid — Check validity