->fetch() -- fetch next row
Opis
The fetch method gets the next row and sets the objects variables to the rows data.
It returns TRUE if data has been collected, and FALSE when there is no more data.
Zwracana wartość
boolean - TRUE on success and FALSE on failure.
Uwagi
Ta funkcja nie może być wywołana
statycznie.
Fetch is called by staticGet and get calls, so you can override this method in your
classes, to add extra data to your object (like formated dates etc)
Przykład
Przykład 35-1. Simple find and fetch of data based on object Vars
<?php
$person = new DataObjects_Person;
$person->hair = 'red';
$person->has_glasses = 1;
$number_of_rows = $person->find();
$people = array();
while ($person->fetch()) {
/* store the results in an array */
$people[] = clone($person);
echo "GOT {$person->name}<BR>";
}
?>
|
|