From c2381df90612de26f2b3524897a61f0d8ad8cb0b Mon Sep 17 00:00:00 2001 From: Silvio Date: Thu, 1 Jul 2010 15:00:10 -0300 Subject: Adding IsisRowIterator --- classes/IsisRowIterator.php | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 classes/IsisRowIterator.php (limited to 'classes/IsisRowIterator.php') diff --git a/classes/IsisRowIterator.php b/classes/IsisRowIterator.php new file mode 100644 index 0000000..a81373e --- /dev/null +++ b/classes/IsisRowIterator.php @@ -0,0 +1,58 @@ +total = $class->getRows($field); + } + + /** + * Rewind the Iterator to the first element. + */ + function rewind() { + $this->position = 0; + } + + /** + * Return the key of the current element. + */ + function key() { + return $this->position; + } + + /** + * Return the current element. + */ + function current() { + return $this->position; + } + + /** + * Move forward to next element. + */ + function next() { + ++$this->position; + } + + /** + * Check if there is a current element after calls to rewind() or next(). + */ + function valid() { + return $this->position <= $this->total; + } +} -- cgit v1.2.3