# La clase RecursiveTreeIterator

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

## Introducción

Permite recorrer un RecursiveIterator para generar un árbol gráfico ASCII.

## Sinopsis de la Clase

class RecursiveTreeIterator extends RecursiveIteratorIterator {
/* Constantaes heredadas constants */
const integer RecursiveIteratorIterator::LEAVES_ONLY = 0;
const integer RecursiveIteratorIterator::SELF_FIRST = 1;
const integer RecursiveIteratorIterator::CHILD_FIRST = 2;
const integer RecursiveIteratorIterator::CATCH_GET_CHILD = 16;
/* Constantes */
public const int BYPASS_CURRENT;
public const int BYPASS_KEY;
public const int PREFIX_LEFT;
public const int PREFIX_MID_HAS_NEXT = 1;
public const int PREFIX_MID_LAST = 2;
public const int PREFIX_END_HAS_NEXT = 3;
public const int PREFIX_END_LAST = 4;
public const int PREFIX_RIGHT = 5;
/* Métodos */
public __construct(
RecursiveIterator|IteratorAggregate `$iterator`,
int `$flags` = RecursiveTreeIterator::BYPASS_KEY,
int `$cachingIteratorFlags` = CachingIterator::CATCH_GET_CHILD,
int `$mode` = RecursiveTreeIterator::SELF_FIRST
)
public beginChildren(): void
public beginIteration(): RecursiveIterator
public callGetChildren(): RecursiveIterator
public callHasChildren(): bool
public current(): mixed
public endChildren(): void
public endIteration(): void
public getEntry(): string
public getPostfix(): string
public getPrefix(): string
public key(): mixed
public next(): void
public nextElement(): void
public rewind(): void
public setPostfix(string `$postfix`): void
public setPrefixPart(int `$part`, string `$value`): void
public valid(): bool
/* Métodos heredados */
}

## Constantes predefinidas

`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`

## Tabla de contenidos

- RecursiveTreeIterator::beginChildren — Inicio de los hijos
- RecursiveTreeIterator::beginIteration — Inicio de la iteración
- RecursiveTreeIterator::callGetChildren — Obtener los hijos
- RecursiveTreeIterator::callHasChildren — Comprobar si tiene hijos
- RecursiveTreeIterator::__construct — Construye un nuevo RecursiveTreeIterator
- RecursiveTreeIterator::current — Obtener el elemento actual
- RecursiveTreeIterator::endChildren — Final de los hijos
- RecursiveTreeIterator::endIteration — Fin de la iteración
- RecursiveTreeIterator::getEntry — obtener la entrada actual
- RecursiveTreeIterator::getPostfix — Obtiener el postfijo
- RecursiveTreeIterator::getPrefix — Obtener el prefijo
- RecursiveTreeIterator::key — Obtiene la clave del elemento actual
- RecursiveTreeIterator::next — Mover al siguiente elemento
- RecursiveTreeIterator::nextElement — Comprueba si hay un siguiente elemento
- RecursiveTreeIterator::rewind — Rebobina el iterador
- RecursiveTreeIterator::setPostfix — Set postfix
- RecursiveTreeIterator::setPrefixPart — Establece la parte de el prefijo
- RecursiveTreeIterator::valid — Comprueba la validez