1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (https://davidgrudl.com)
6: */
7:
8: namespace Nette\Iterators;
9:
10:
11: /**
12: * RecursiveCallbackFilterIterator for PHP < 5.4.
13: */
14: class RecursiveFilter extends Filter implements \RecursiveIterator
15: {
16:
17: public function __construct(\RecursiveIterator $iterator, $callback)
18: {
19: parent::__construct($iterator, $callback);
20: }
21:
22:
23: public function hasChildren()
24: {
25: return $this->getInnerIterator()->hasChildren();
26: }
27:
28:
29: public function getChildren()
30: {
31: return new static($this->getInnerIterator()->getChildren(), $this->callback);
32: }
33:
34: }
35: