4
* This file is part of the Nette Framework (http://nette.org)
6
* Copyright (c) 2004 David Grudl (http://davidgrudl.com)
8
* For the full copyright and license information, please view
9
* the file license.txt that was distributed with this source code.
12
namespace Nette\Iterators;
18
* CallbackFilterIterator for PHP < 5.4.
22
class Filter extends \FilterIterator
28
public function __construct(\Iterator $iterator, $callback)
30
parent::__construct($iterator);
31
$this->callback = Nette\Utils\Callback::check($callback);
35
public function accept()
37
return call_user_func($this->callback, $this->current(), $this->key(), $this);