contenido\classes\class.iterator.php
Description: Iterator class
Requirements:
- Author
- unknown
- Con_php_req
- 5.0
- Copyright
- four for business AG
- License
- http://www.contenido.org/license/LIZENZ.txt
- Link
- http://www.4fb.de
- Link
- http://www.contenido.org
- Package
- Contenido Backend classes
- Since
- file available since contenido release <= 4.6 {@internal created unknown modified 2008-06-30, Dominik Ziegler, add security fix $Id: class.iterator.php 416 2008-06-30 12:25:01Z dominik.ziegler $: }}
- Version
- 1.0.2
\cIterator
Iterating items is a mechanism to "step" trough a list of defined items. Basically, the iterator is similar to an array, but provides easy functions to step trough the list.
An instance of an iterator is usually created by a class returning multiple items and automatically filled using the $aItems parameter of the constructor, and then returned to the caller.
The caller receives the iterator object and can step trough all items using the "next" method.
- Todo
- Add more stepping methods, as well as retrieving items
Properties
Methods


cIterator( $aItems) : \none
Iterator constructor
This function initializes the constructor, adds the passed items and moves the iterator to the first element.
Name | Type | Description |
---|---|---|
$aItems | array Items to add |
Type | Description |
---|---|
\none |


count() : int
count: Returns the number of items in the iterator
Type | Description |
---|---|
int | Number of items |


next() : mixed
next: Returns the next item in the iterator
This function returns the item, or false if no items are left.
Type | Description |
---|---|
mixed | item or false if nothing was found |