summaryrefslogtreecommitdiff
path: root/ext/spl/examples/parentiterator.inc
blob: 4b758132ac88816795c677c689e7517c7e0f0159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php

class ParentIterator extends FilterIterator implements RecursiveIterator
{
	function __construct(RecursiveIterator $it)
	{
		parent::__construct($it);
	}
	function accept()
	{
		return $this->it->hasChildren();
	}

	function hasChildren()
	{
		return $this->it->hasChildren();
	}

	function getChildren()
	{
		return new ParentIterator($this->it->getChildren());
	}
}

?>