contenido\classes\class.iterator.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

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

Package: Default
cIterator: A class which represents the C/C++/JAVA Iterator support.

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

>VPropertypublicarray $_aIteratorItems
Holds the items which should be iterated
Details
Type
array

Methods

methodpubliccIterator( $aItems) : \none

Iterator constructor

This function initializes the constructor, adds the passed items and moves the iterator to the first element.

Parameters
NameTypeDescription
$aItems

array Items to add

Returns
TypeDescription
\none
methodpubliccount() : int

count: Returns the number of items in the iterator

Returns
TypeDescription
intNumber of items
methodpublicnext() : mixed

next: Returns the next item in the iterator

This function returns the item, or false if no items are left.

Returns
TypeDescription
mixeditem or false if nothing was found
methodpublicreset() : \none

reset: Resets the iterator to the first element

This function moves the iterator to the first element

Returns
TypeDescription
\none
Documentation was generated by phpDocumentor 2.0.0a12.