Class NoChildrenIterator
An iterator that can be used as an argument for other iterators that require a RecursiveIterator but do not want children. This iterator will always behave as having no nested items.
- IteratorIterator implements Iterator, Traversable, OuterIterator
-
Cake\Collection\Collection implements Cake\Collection\CollectionInterface, Serializable uses Cake\Collection\CollectionTrait
-
Cake\Collection\Iterator\NoChildrenIterator implements RecursiveIterator
Method Summary
-
getChildren() public
Returns null as there are no children for this iteration level -
hasChildren() public
Returns false as there are no children iterators in this collection
Method Detail
getChildren() public ¶
getChildren( )
Returns null as there are no children for this iteration level
Returns
Implementation of
RecursiveIterator::getChildren()
hasChildren() public ¶
hasChildren( )
Returns false as there are no children iterators in this collection
Returns
Implementation of
RecursiveIterator::hasChildren()
Methods inherited from Cake\Collection\Collection
__construct() public ¶
__construct( array|Traversable $items )
Constructor. You can provide an array or any traversable object
Parameters
- array|Traversable $items
- Items.
Throws
If passed incorrect type for items.
Overrides
IteratorIterator::__construct()
__debugInfo() public ¶
__debugInfo( )
Returns an array that can be used to describe the internal state of this object.
Returns
count() public ¶
count( )
Throws an exception.
Issuing a count on a Collection can have many side effects, some making the Collection unusable after the count operation.
Throws
serialize() public ¶
serialize( )
Returns a string representation of this object that can be used to reconstruct it
Returns
Implementation of
Serializable::serialize()
unserialize() public ¶
unserialize( string $collection )
Unserializes the passed string and rebuilds the Collection instance
Parameters
- string $collection
- The serialized collection
Implementation of
Serializable::unserialize()
Methods used from Cake\Collection\CollectionTrait
cartesianProduct() public ¶
cartesianProduct( callable $operation = null , callable $filter = null )
optimizeUnwrap() protected ¶
optimizeUnwrap( )
Unwraps this iterator and returns the simplest traversable that can be used for getting the data out