Рекурсивный акроним словосочетания «PHP: Hypertext Preprocessor»
Добро пожаловать на форум PHP программистов!
За последние 24 часа нас посетили 17999 программистов и 1566 роботов. Сейчас ищут 1852 программиста ...
->find()
Вернуться к: DB_DataObject
->find()
->find() – find results
Synopsis
int $DB_DataObject->find ( boolean $autoFetch )
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.
Parameter
-
boolean $autoFetch - fetch first result
Return value
int - number of rows found, only if the database backend supports the numRows() method. Otherwise 1 (or in versions after 1.7.13, true will returned)
Note
This function can not be called statically.
Example
Simple find() of data based on Object Vars
<?php
$person = new DataObjects_Person;
$person->hair = 'red';
$person->has_glasses = 1;
$number_of_rows = $person->find();
?>
Resulting SQL
<?php
SELECT * FROM person WHERE hair='red' and has_glasses = 1
?>
Вернуться к: DB_DataObject