Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
Public Member Functions
Dataface_ResultReader Class Reference

A class for reading records from the database. More...

Public Member Functions

 __construct ($sql, $db, $bufferSize=30, $decorator=null)
 Creates a new record reader.
 __destruct ()
 Destructor. Frees memory.
 rewind ()
 Rewinds the pointer to the beginning of the found set.
 getQuery ($start, $limit)
 current ()
 Returns the current record.
 key ()
 Returns the index of the current position.
 next ()
 Increments the current position to the next position.
 valid ()
 Checks to see if the current position is valid.

Detailed Description

A class for reading records from the database.

Usage

$query = "select * from people"; $reader = new Dataface_ResultReader($query, $db); foreach ($reader as $key=>$person){ // do something with $person Dataface_Record object. }

See Also
Dataface_RecordReader For a similar API that works with Xataface query associative arrays and Dataface_Record objects.

June 26, 2012

Author
Steve Hannah steve.nosp@m.@web.nosp@m.lite..nosp@m.ca

Definition at line 23 of file ResultReader.php.

Constructor & Destructor Documentation

__construct (   $sql,
  $db,
  $bufferSize = 30,
  $decorator = null 
)

Creates a new record reader.

Parameters
string$sqlThe SQL query for the set to retrieve.
resource$dbThe database resource connection.
int$bufferSizeThe size of the buffer.

Definition at line 79 of file ResultReader.php.

__destruct ( )

Destructor. Frees memory.

Definition at line 106 of file ResultReader.php.

Member Function Documentation

current ( )

Returns the current record.

Returns
StdClass The current record.

Definition at line 175 of file ResultReader.php.

getQuery (   $start,
  $limit 
)

Definition at line 132 of file ResultReader.php.

key ( )

Returns the index of the current position.

Returns
int The current position within the foundset.

Definition at line 184 of file ResultReader.php.

next ( )

Increments the current position to the next position.

Definition at line 191 of file ResultReader.php.

rewind ( )

Rewinds the pointer to the beginning of the found set.

Definition at line 114 of file ResultReader.php.

valid ( )

Checks to see if the current position is valid.

Definition at line 198 of file ResultReader.php.


The documentation for this class was generated from the following file: