# La classe RecursiveTreeIterator

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

## Introduction

Permet l'itération d'un RecursiveIterator pour générer un arbre graphique ASCII.

## Synopsis de la classe

class RecursiveTreeIterator extends RecursiveIteratorIterator {
/* Constantes héritées */
public const int RecursiveIteratorIterator::LEAVES_ONLY;
public const int RecursiveIteratorIterator::SELF_FIRST;
public const int RecursiveIteratorIterator::CHILD_FIRST;
public const int RecursiveIteratorIterator::CATCH_GET_CHILD;
/* 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éthodes */
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éthodes héritées */
public RecursiveIteratorIterator::beginChildren(): void
public RecursiveIteratorIterator::beginIteration(): void
public RecursiveIteratorIterator::callGetChildren(): ?RecursiveIterator
public RecursiveIteratorIterator::callHasChildren(): bool
public RecursiveIteratorIterator::current(): mixed
public RecursiveIteratorIterator::endChildren(): void
public RecursiveIteratorIterator::endIteration(): void
public RecursiveIteratorIterator::getDepth(): int
public RecursiveIteratorIterator::getInnerIterator(): RecursiveIterator
public RecursiveIteratorIterator::getMaxDepth(): int|false
public RecursiveIteratorIterator::getSubIterator(?int `$level` = `null`): ?RecursiveIterator
public RecursiveIteratorIterator::key(): mixed
public RecursiveIteratorIterator::next(): void
public RecursiveIteratorIterator::nextElement(): void
public RecursiveIteratorIterator::rewind(): void
public RecursiveIteratorIterator::setMaxDepth(int `$maxDepth` = -1): void
public RecursiveIteratorIterator::valid(): bool
}

## Constantes pré-définies

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

## Sommaire

- RecursiveTreeIterator::beginChildren — Début d'un fils
- RecursiveTreeIterator::beginIteration — Début d'une itération
- RecursiveTreeIterator::callGetChildren — Récupère un fils
- RecursiveTreeIterator::callHasChildren — Vérifie la présence d'un fils
- RecursiveTreeIterator::__construct — Construit un nouvel objet RecursiveTreeIterator
- RecursiveTreeIterator::current — Récupère l'élément courant
- RecursiveTreeIterator::endChildren — Fin d'un fils
- RecursiveTreeIterator::endIteration — Fin de l'itération
- RecursiveTreeIterator::getEntry — Récupère l'entrée courante
- RecursiveTreeIterator::getPostfix — Récupère le suffixe
- RecursiveTreeIterator::getPrefix — Récupère le préfixe
- RecursiveTreeIterator::key — Récupère la clé de l'élément courant
- RecursiveTreeIterator::next — Se déplace sur l'élément suivant
- RecursiveTreeIterator::nextElement — Prochain élément
- RecursiveTreeIterator::rewind — Réinitialise la position de l'itérateur
- RecursiveTreeIterator::setPostfix — Définit le suffixe
- RecursiveTreeIterator::setPrefixPart — Définit une partie du préfixe
- RecursiveTreeIterator::valid — Vérifie la validité