int $DB_DataObject->find ([boolean $autoFetch])
int $DB_DataObject->find
The find method builds and executes the current Query, based on the object variables and any WhereAdd() conditions , If the AutoFetch is TRUE, then it will also call the fetch method automatically.
boolean $autoFetch - fetch first result
int - number of rows found
This function can not be called statically.
Example 26-1. Simple find() of data based on Object Vars
$person = new DataObjects_Person; $person->hair = 'red'; $person->has_glasses = 1; $number_of_rows = $person->find();
Example 26-2. Resulting SQL
SELECT * FROM person WHERE hair='red' and has_glasses = 1