<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>The RecursiveIteratorIterator class</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="recursivefilteriterator.haschildren.html">RecursiveFilterIterator::hasChildren</a></div> <div class="next" style="text-align: right; float: right;"><a href="recursiveiteratoriterator.beginchildren.html">RecursiveIteratorIterator::beginChildren</a></div> <div class="up"><a href="spl.iterators.html">Iterators</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="class.recursiveiteratoriterator" class="reference"> <h1 class="title">The RecursiveIteratorIterator class</h1> <div class="partintro"><p class="verinfo">(PHP 5)</p> <div class="section" id="recursiveiteratoriterator.intro"> <h2 class="title">Introduction</h2> <p class="para"> Can be used to iterate through recursive iterators. </p> </div> <div class="section" id="recursiveiteratoriterator.synopsis"> <h2 class="title">Class synopsis</h2> <div class="classsynopsis"> <div class="ooclass"></div> <div class="classsynopsisinfo"> <span class="ooclass"> <strong class="classname">RecursiveIteratorIterator</strong> </span> <span class="oointerface">implements <span class="interfacename"><a href="class.outeriterator.html" class="interfacename">OuterIterator</a></span> </span> {</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div> <div class="fieldsynopsis"> <span class="modifier">const</span> <span class="type">integer</span> <var class="fieldsynopsis_varname"><a href="class.recursiveiteratoriterator.html#recursiveiteratoriterator.constants.leaves-only"><var class="varname">LEAVES_ONLY</var></a></var> <span class="initializer"> = 0</span> ;</div> <div class="fieldsynopsis"> <span class="modifier">const</span> <span class="type">integer</span> <var class="fieldsynopsis_varname"><a href="class.recursiveiteratoriterator.html#recursiveiteratoriterator.constants.self-first"><var class="varname">SELF_FIRST</var></a></var> <span class="initializer"> = 1</span> ;</div> <div class="fieldsynopsis"> <span class="modifier">const</span> <span class="type">integer</span> <var class="fieldsynopsis_varname"><a href="class.recursiveiteratoriterator.html#recursiveiteratoriterator.constants.child-first"><var class="varname">CHILD_FIRST</var></a></var> <span class="initializer"> = 2</span> ;</div> <div class="fieldsynopsis"> <span class="modifier">const</span> <span class="type">integer</span> <var class="fieldsynopsis_varname"><a href="class.recursiveiteratoriterator.html#recursiveiteratoriterator.constants.catch-get-child"><var class="varname">CATCH_GET_CHILD</var></a></var> <span class="initializer"> = 16</span> ;</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.beginchildren.html" class="methodname">beginChildren</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.beginiteration.html" class="methodname">beginIteration</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">RecursiveIterator</span> <span class="methodname"><a href="recursiveiteratoriterator.callgetchildren.html" class="methodname">callGetChildren</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="recursiveiteratoriterator.callhaschildren.html" class="methodname">callHasChildren</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><a href="recursiveiteratoriterator.construct.html" class="methodname">__construct</a></span> ( <span class="methodparam"><span class="type"><a href="class.traversable.html" class="type Traversable">Traversable</a></span> <code class="parameter">$iterator</code></span> [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code><span class="initializer"> = RecursiveIteratorIterator::LEAVES_ONLY</span></span> [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span> ]] )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">mixed</span> <span class="methodname"><a href="recursiveiteratoriterator.current.html" class="methodname">current</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.endchildren.html" class="methodname">endChildren</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.enditeration.html" class="methodname">endIteration</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">int</span> <span class="methodname"><a href="recursiveiteratoriterator.getdepth.html" class="methodname">getDepth</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">iterator</span> <span class="methodname"><a href="recursiveiteratoriterator.getinneriterator.html" class="methodname">getInnerIterator</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">mixed</span> <span class="methodname"><a href="recursiveiteratoriterator.getmaxdepth.html" class="methodname">getMaxDepth</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">RecursiveIterator</span> <span class="methodname"><a href="recursiveiteratoriterator.getsubiterator.html" class="methodname">getSubIterator</a></span> ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$level</code></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">mixed</span> <span class="methodname"><a href="recursiveiteratoriterator.key.html" class="methodname">key</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.next.html" class="methodname">next</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.nextelement.html" class="methodname">nextElement</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.rewind.html" class="methodname">rewind</a></span> ( <span class="methodparam">void</span> )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">void</span> <span class="methodname"><a href="recursiveiteratoriterator.setmaxdepth.html" class="methodname">setMaxDepth</a></span> ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$max_depth</code><span class="initializer"> = -1</span></span> ] )</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><a href="recursiveiteratoriterator.valid.html" class="methodname">valid</a></span> ( <span class="methodparam">void</span> )</div> <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">Iterator</span> <span class="methodname"><a href="outeriterator.getinneriterator.html" class="methodname">OuterIterator::getInnerIterator</a></span> ( <span class="methodparam">void</span> )</div> }</div> </div> <div class="section" id="recursiveiteratoriterator.constants"> <h2 class="title">Predefined Constants</h2> <dl> <dt id="recursiveiteratoriterator.constants.leaves-only"> <span class="term"><strong><code>RecursiveIteratorIterator::LEAVES_ONLY</code></strong></span> <dd> <p class="para"/> </dd> </dt> <dt id="recursiveiteratoriterator.constants.self-first"> <span class="term"><strong><code>RecursiveIteratorIterator::SELF_FIRST</code></strong></span> <dd> <p class="para"/> </dd> </dt> <dt id="recursiveiteratoriterator.constants.child-first"> <span class="term"><strong><code>RecursiveIteratorIterator::CHILD_FIRST</code></strong></span> <dd> <p class="para"/> </dd> </dt> <dt id="recursiveiteratoriterator.constants.catch-get-child"> <span class="term"><strong><code>RecursiveIteratorIterator::CATCH_GET_CHILD</code></strong></span> <dd> <p class="para"/> </dd> </dt> </dl> </div> </div> <h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="recursiveiteratoriterator.beginchildren.html">RecursiveIteratorIterator::beginChildren</a> — Begin children</li><li><a href="recursiveiteratoriterator.beginiteration.html">RecursiveIteratorIterator::beginIteration</a> — Begin Iteration</li><li><a href="recursiveiteratoriterator.callgetchildren.html">RecursiveIteratorIterator::callGetChildren</a> — Get children</li><li><a href="recursiveiteratoriterator.callhaschildren.html">RecursiveIteratorIterator::callHasChildren</a> — Has children</li><li><a href="recursiveiteratoriterator.construct.html">RecursiveIteratorIterator::__construct</a> — Construct a RecursiveIteratorIterator</li><li><a href="recursiveiteratoriterator.current.html">RecursiveIteratorIterator::current</a> — Access the current element value</li><li><a href="recursiveiteratoriterator.endchildren.html">RecursiveIteratorIterator::endChildren</a> — End children</li><li><a href="recursiveiteratoriterator.enditeration.html">RecursiveIteratorIterator::endIteration</a> — End Iteration</li><li><a href="recursiveiteratoriterator.getdepth.html">RecursiveIteratorIterator::getDepth</a> — Get the current depth of the recursive iteration</li><li><a href="recursiveiteratoriterator.getinneriterator.html">RecursiveIteratorIterator::getInnerIterator</a> — Get inner iterator</li><li><a href="recursiveiteratoriterator.getmaxdepth.html">RecursiveIteratorIterator::getMaxDepth</a> — Get max depth</li><li><a href="recursiveiteratoriterator.getsubiterator.html">RecursiveIteratorIterator::getSubIterator</a> — The current active sub iterator</li><li><a href="recursiveiteratoriterator.key.html">RecursiveIteratorIterator::key</a> — Access the current key</li><li><a href="recursiveiteratoriterator.next.html">RecursiveIteratorIterator::next</a> — Move forward to the next element</li><li><a href="recursiveiteratoriterator.nextelement.html">RecursiveIteratorIterator::nextElement</a> — Next element</li><li><a href="recursiveiteratoriterator.rewind.html">RecursiveIteratorIterator::rewind</a> — Rewind the iterator to the first element of the top level inner iterator</li><li><a href="recursiveiteratoriterator.setmaxdepth.html">RecursiveIteratorIterator::setMaxDepth</a> — Set max depth</li><li><a href="recursiveiteratoriterator.valid.html">RecursiveIteratorIterator::valid</a> — Check whether the current position is valid</li></ul> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="recursivefilteriterator.haschildren.html">RecursiveFilterIterator::hasChildren</a></div> <div class="next" style="text-align: right; float: right;"><a href="recursiveiteratoriterator.beginchildren.html">RecursiveIteratorIterator::beginChildren</a></div> <div class="up"><a href="spl.iterators.html">Iterators</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>