previous{Child Class}::staticGet() (Previous) (Next) ->fetch()next

View this page in Last updated: Sun, 21 Jun 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

->find()

->find() – 結果を検索する

Synopsis

int $DB_DataObject->find ( boolean $autoFetch )

Description

find メソッドは、オブジェクト変数と WhereAdd() 条件に基づいた現在のクエリを作成し実行します。 もし、AutoFetch が TRUE ならは、 fetch メソッドも自動的にコールされます。

Parameter

  • boolean $autoFetch - 最初の結果をフェッチするかどうかを指定します

Return value

int - データベースバックエンドが numRows() メソッドをサポートする場合は見つかった件数。そうでなければ 1 (あるいは、1.7.13以降は true が返されます)

Note

This function can not be called statically.

Example

オブジェクト変数に基づいたデータの単純な find()

<?php
$person 
= new DataObjects_Person;
$person->hair 'red';
$person->has_glasses 1;
$number_of_rows $person->find();
?>

結果の SQL

<?php
SELECT 
FROM person WHERE hair='red' and has_glasses 1
?>
previous{Child Class}::staticGet() (Previous) (Next) ->fetch()next

Download Documentation Last updated: Sun, 21 Jun 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.