close
Phork Manual Table of Contents
Phork Framework User Guide 1.3.4

CoreIterator

Filepath: phork/php/core/CoreIterator.class.php

The CoreIterator class stores a collection of items that can be iterated through, as well as providing methods to retrieve the first and last items, and to be able to add, modify and remove items.

There currently 2 extensions to the CoreIterator class in phork/php/ext/iterators/.


Example

$objList = new ObjectIterator();

$objList->append($objRecord1);
$objList->append($objRecord2);
$objList->append($objRecord3);

$objList->removeByPosition(2);

$objList->rewind();
while (list($intKey, $objRecord) = $objList->each()) {
    $objRecord->save();
}