mirror of
https://github.com/php/php-src.git
synced 2024-10-09 02:36:28 +00:00
25 lines
378 B
PHP
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());
|
|
}
|
|
}
|
|
|
|
?>
|