Class RdqlResultIterator

Description

Iterator for traversing Rdql results.

This class can be used for iterating forward and backward trough Rdql results. It should be instanced using the rdqlQueryAsIterator() method of a MemModel or a DBModel.

  • author: Daniel Westphal <mail@d-westphal.de>, Chris Bizer <chris@bizer.de>
  • version: $Id: RdqlResultIterator.html 443 2007-06-01 16:25:38Z cax $
  • access: public

Located in /rdql/RdqlResultIterator.php (line 19)

Object
   |
   --RdqlResultIterator
Method Summary
RdqlResultIterator RdqlResultIterator (object RdqlResult &$RdqlResult)
integer countResults ()
result current ([integer $element = null])
integer getCurrentPosition ()
array getResultLabels ()
boolean hasNext ()
boolean hasPrevious ()
void moveFirst ()
void moveLast ()
void moveTo ( $position)
result next ([integer $element = null])
result previous ([integer $element = null])
Methods
Constructor RdqlResultIterator (line 44)

Constructor

  • access: public
RdqlResultIterator RdqlResultIterator (object RdqlResult &$RdqlResult)
  • object RdqlResult &$RdqlResult
countResults (line 77)

Returns the number of results.

  • access: public
integer countResults ()
current (line 145)

Returns the current result.

  • return: array OR single result if $element was specified OR NULL if there is no next result.
  • access: public
result current ([integer $element = null])
  • integer $element
getCurrentPosition (line 187)

Returns the current position of the iterator.

  • access: public
integer getCurrentPosition ()
getResultLabels (line 66)

Returns the labels of the result as array.

  • return: of strings with the result labels OR null if there are no results.
  • access: public
array getResultLabels ()
hasNext (line 87)

Returns TRUE if there are more results.

  • access: public
boolean hasNext ()
hasPrevious (line 100)

Returns TRUE if the first result has not been reached.

  • access: public
boolean hasPrevious ()
moveFirst (line 159)

Moves the pointer to the first result.

  • access: public
void moveFirst ()
moveLast (line 168)

Moves the pointer to the last result.

  • access: public
void moveLast ()
moveTo (line 178)

Moves the pointer to a specific result.

If you set an off-bounds value, next(), previous() and current() will return NULL

  • access: public
void moveTo ( $position)
  • $position
next (line 113)

Returns the next result array.

  • return: array OR single result if $element was specified OR NULL if there is no next result.
  • access: public
result next ([integer $element = null])
  • integer $element
previous (line 129)

Returns the previous result.

  • return: array OR single result if $element was specified OR NULL if there is no next result.
  • access: public
result previous ([integer $element = null])
  • integer $element

Inherited Methods

Inherited From Object

Object::toString()

Documentation generated on Fri, 1 Jun 2007 16:51:20 +0200 by phpDocumentor 1.3.2