php-src/ext/spl/examples/parentiterator.inc
2003-11-30 16:20:03 +00:00

25 lines
378 B
PHP

<?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());
}
}
?>