xref: /PHP-5.4/ext/spl/internal/parentiterator.inc (revision 1b9e0de2)
1<?php
2
3/** @file parentiterator.inc
4 * @ingroup SPL
5 * @brief class FilterIterator
6 * @author  Marcus Boerger
7 * @date    2003 - 2009
8 *
9 * SPL - Standard PHP Library
10 */
11
12/**
13 * @brief   Iterator to filter parents
14 * @author  Marcus Boerger
15 * @version 1.2
16 * @since PHP 5.1
17 *
18 * This extended FilterIterator allows a recursive iteration using
19 * RecursiveIteratorIterator that only shows those elements which have
20 * children.
21 */
22class ParentIterator extends RecursiveFilterIterator
23{
24	/** @return whetehr the current element has children
25	 */
26	function accept()
27	{
28		return $this->it->hasChildren();
29	}
30}
31
32?>