![]() |
Xataface
2.0alpha2
Xataface Application Framework
|
A class for reading records from the database. It takes a Xataface query array in the constructor. This can be iterated just like an array, and the records are loaded from the database as needed. It keeps an internal buffer for the actual records so that it doesn't need to make a DB request for every record. More...
Public Member Functions | |
| __construct (array $query, $bufferSize=30, $previewRecords=true) | |
| Creates a new record reader. | |
| __destruct () | |
| Destructor. Frees memory. | |
| rewind () | |
| Rewinds the pointer to the beginning of the found set. | |
| 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. | |
Data Fields | |
| $previewRecords = true | |
| True if the loaded records should be previews. (Previews truncate long fields. | |
A class for reading records from the database. It takes a Xataface query array in the constructor. This can be iterated just like an array, and the records are loaded from the database as needed. It keeps an internal buffer for the actual records so that it doesn't need to make a DB request for every record.
$query = array('-table' => 'People', 'country'=>'Canada'); $reader = new Dataface_RecordReader($query); foreach ($reader as $key=>$person){ // do something with $person Dataface_Record object. }
June 26, 2012
Definition at line 25 of file RecordReader.php.
| __construct | ( | array | $query, |
$bufferSize = 30, |
|||
$previewRecords = true |
|||
| ) |
Creates a new record reader.
| array | $query | The associative array with the query information. |
| int | $bufferSize | The size of the buffer. |
| boolean | $previewRecords | Whether to return previews of records. If this is false, then the full records will be returned, even if some of the fields contain a lot of text. |
Definition at line 89 of file RecordReader.php.
| __destruct | ( | ) |
Destructor. Frees memory.
Definition at line 104 of file RecordReader.php.
| current | ( | ) |
Returns the current record.
Definition at line 159 of file RecordReader.php.
| key | ( | ) |
Returns the index of the current position.
Definition at line 168 of file RecordReader.php.
| next | ( | ) |
Increments the current position to the next position.
Definition at line 175 of file RecordReader.php.
| rewind | ( | ) |
Rewinds the pointer to the beginning of the found set.
Definition at line 112 of file RecordReader.php.
| valid | ( | ) |
Checks to see if the current position is valid.
Definition at line 182 of file RecordReader.php.
| $previewRecords = true |
True if the loaded records should be previews. (Previews truncate long fields.
boolean
Definition at line 77 of file RecordReader.php.
1.8.1.2