Namespaces

  • Nette
    • Application
      • Diagnostics
      • Responses
      • Routers
      • UI
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Diagnostics
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Diagnostics
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
      • Diagnostics
    • Iterators
    • Latte
      • Macros
    • Loaders
    • Localization
    • Mail
    • PhpGenerator
    • Reflection
    • Security
      • Diagnostics
    • Templating
    • Utils
  • NetteModule
  • none

Classes

  • CachingIterator
  • Filter
  • Mapper
  • RecursiveFilter
  • Recursor
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage
 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: use Nette;
11: 
12: 
13: /**
14:  * CallbackFilterIterator for PHP < 5.4.
15:  *
16:  * @author     David Grudl
17:  */
18: class Filter extends \FilterIterator
19: {
20:     /** @var callable */
21:     protected $callback;
22: 
23: 
24:     public function __construct(\Iterator $iterator, $callback)
25:     {
26:         parent::__construct($iterator);
27:         $this->callback = Nette\Utils\Callback::check($callback);
28:     }
29: 
30: 
31:     public function accept()
32:     {
33:         return call_user_func($this->callback, $this->current(), $this->key(), $this);
34:     }
35: 
36: }
37: 
Nette 2.1 API documentation generated by ApiGen 2.8.0