在线文档教程
PHP

RecursiveIteratorIterator (class)

The RecursiveIteratorIterator class

Introduction

(PHP 5, PHP 7)

Can be used to iterate through recursive iterators.

Class synopsis

RecursiveIteratorIterator implements OuterIterator {

/* Constants */

const integer LEAVES_ONLY = 0 ;

const integer SELF_FIRST = 1 ;

const integer CHILD_FIRST = 2 ;

const integer CATCH_GET_CHILD = 16 ;

/* Methods */

public void beginChildren ( void )

public void beginIteration ( void )

public RecursiveIterator callGetChildren ( void )

public bool callHasChildren ( void )

public __construct ( Traversable $iterator [, int $mode = RecursiveIteratorIterator::LEAVES_ONLY [, int $flags = 0 ]] )

public mixed current ( void )

public void endChildren ( void )

public void endIteration ( void )

public int getDepth ( void )

public iterator getInnerIterator ( void )

public mixed getMaxDepth ( void )

public RecursiveIterator getSubIterator ([ int $level ] )

public mixed key ( void )

public void next ( void )

public void nextElement ( void )

public void rewind ( void )

public void setMaxDepth ([ string $max_depth = -1 ] )

public bool valid ( void )

/* Inherited methods */

public Iterator OuterIterator::getInnerIterator ( void )

}

Predefined Constants

RecursiveIteratorIterator::LEAVES_ONLYRecursiveIteratorIterator::SELF_FIRSTRecursiveIteratorIterator::CHILD_FIRSTRecursiveIteratorIterator::CATCH_GET_CHILD

Table of Contents

  • RecursiveIteratorIterator::beginChildren — Begin children

  • RecursiveIteratorIterator::beginIteration — Begin Iteration

  • RecursiveIteratorIterator::callGetChildren — Get children

  • RecursiveIteratorIterator::callHasChildren — Has children

  • RecursiveIteratorIterator::__construct — Construct a RecursiveIteratorIterator

  • RecursiveIteratorIterator::current — Access the current element value

  • RecursiveIteratorIterator::endChildren — End children

  • RecursiveIteratorIterator::endIteration — End Iteration

  • RecursiveIteratorIterator::getDepth — Get the current depth of the recursive iteration

  • RecursiveIteratorIterator::getInnerIterator — Get inner iterator

  • RecursiveIteratorIterator::getMaxDepth — Get max depth

  • RecursiveIteratorIterator::getSubIterator — The current active sub iterator

  • RecursiveIteratorIterator::key — Access the current key

  • RecursiveIteratorIterator::nextElement — Next element

  • RecursiveIteratorIterator::rewind — Rewind the iterator to the first element of the top level inner iterator

  • RecursiveIteratorIterator::setMaxDepth — Set max depth

  • RecursiveIteratorIterator::valid — Check whether the current position is valid

← RecursiveFilterIterator::hasChildren

RecursiveIteratorIterator::beginChildren →

© 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

https://secure.php.net/manual/en/class.recursiveiteratoriterator.php