SourceForge.net LogoPHPGallue
[ class tree: libbase ] [ index: libbase ] [ all elements ]

Class: GALResultIterator

Source Location: /libbase/result.inc.php

Interface Overview

GALDesc
   |
   --GALResultIterator

A set of GALRow objects.


Author(s):

Methods


Inherited Methods

Class: GALDesc

GALDesc::countFields()
Returns the number of fields contained in a result.
GALDesc::getFields()
Returns all fields contained in a result.
GALDesc::getFlags()
Gets the flags of the given field.
GALDesc::getLength()
Gets the length of the given field.
GALDesc::getParent()
Return the top level parent of an entity.
GALDesc::getTable()
Gets the name of the table the given field is contained in.
GALDesc::getType()
Gets the type of the given field.
GALDesc::isField()
Checks if the given field is contained in a result.

Class Details

[line 104]
A set of GALRow objects.

A class that implements this interface should represent a list or set of GALRow objects with uniform internal structure, this is with the same fields and the same top level parent.




Tags:

todo:  implement some iterator interfaces of the PHP SDL package.


[ Top ]


Class Methods


method count [line 135]

int count( )

Returns the number of rows in this list or set.



[ Top ]

method data_seek [line 110]

void data_seek( int $index)

Moves the internal pointer to the row with the given position inside the list.



Parameters:

int   $index  

[ Top ]

method fetch [line 120]

GALRow fetch( )

Fetches the row the internal pointer points to and sets the internal pointer to the next row.



Tags:

return:  An instance of GALRow or one of it's subclasses.


[ Top ]

method filter [line 145]

GALResultIterator filter( string $callback)

Filters the rows of this iterator with a callback function.

Returns an intance of GALResultIterator that contains all rows of this iterator where the callback function returned TRUE. Signature of the callback function: bool callback(GALRow $row)




Tags:

return:  An iterator on all rows where the callback function returned true.
todo:  Find a way to use static and non-static methods as callback.


Parameters:

string   $callback   The name of a callback function.

[ Top ]

method iterator [line 166]

GALResultIterator iterator( )

Returns a new ResultIterator on the data of this iterator.

This method creates a new iterator that accesses the same data as this iterator. If you want to share data between multiple modules, using the same iterator would be inconvenient because the internal pointer is changed by both modules. Because every GALResultIterator provides access to a row with a certain index via the row() method, it is possible to keep a pointer for each module. The iterator returned by this method provides such an external pointer.




Tags:

return:  Usually a GALIteratorIterator.


[ Top ]

method position [line 115]

int position( )

Gets the index of the row the internal pointer points top.



[ Top ]

method rewind [line 124]

void rewind( )

Moves the internal pointer to position 0.



[ Top ]

method row [line 130]

GALRow row( mixed $index)

Fetches the row with the given index.



Tags:

return:  An instance of GALRow or one of it's subclasses.


[ Top ]

method verticalFetch [line 153]

array verticalFetch( string $field)

Returns the value of a field in all rows of this iterator.

This method fetches the value of the given field from all rows that are in this iterator.




Tags:

return:  An array with all field values as strings.


Parameters:

string   $field   The name of a field.

[ Top ]


Documentation generated on Wed, 16 Aug 2006 15:36:27 +0200 by phpDocumentor 1.3.0RC6