Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationDI
      • ApplicationLatte
      • ApplicationTracy
      • CacheDI
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsDI
      • FormsLatte
      • Framework
      • HttpDI
      • HttpTracy
      • MailDI
      • ReflectionDI
      • SecurityDI
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Conventions
      • Drivers
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
      • Traits
    • Reflection
    • Security
    • Tokenizer
    • Utils
  • Tracy
    • Bridges
      • Nette
  • none

Classes

  • Component
  • Container
  • RecursiveComponentIterator

Interfaces

  • IComponent
  • IContainer

Traits

  • ArrayAccess
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
 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\ComponentModel;
 9: 
10: 
11: /**
12:  * Recursive component iterator. See Container::getComponents().
13:  * @internal
14:  */
15: class RecursiveComponentIterator extends \RecursiveArrayIterator implements \Countable
16: {
17:     /**
18:      * Has the current element has children?
19:      * @return bool
20:      */
21:     public function hasChildren()
22:     {
23:         return $this->current() instanceof IContainer;
24:     }
25: 
26: 
27:     /**
28:      * The sub-iterator for the current element.
29:      * @return \RecursiveIterator
30:      */
31:     public function getChildren()
32:     {
33:         return $this->current()->getComponents();
34:     }
35: 
36: 
37:     /**
38:      * Returns the count of elements.
39:      * @return int
40:      */
41:     public function count()
42:     {
43:         return iterator_count($this);
44:     }
45: }
46: 
Nette 2.4-20180918 API API documentation generated by ApiGen 2.8.0