本文整理汇总了PHP中Dao::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Dao::find方法的具体用法?PHP Dao::find怎么用?PHP Dao::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dao
的用法示例。
在下文中一共展示了Dao::find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateIsDeprecated
/**
* Checks if an update hasn't already been inserted in the database.
*
* @param DatabaseUpdate $update
* @return bool true if the update has already been executed.
*/
public function updateIsDeprecated($update)
{
return !!$this->versionDao->find(array('number' => $update->number, 'username' => $update->username, 'branch' => $update->branch));
}
示例2: Dao
// db select is contained with bmark_connect
if (strlen($db_type) <= 0) {
$db_type = 'drizzle';
}
// phpinfo(); die();
// use software partition
$timer = new Benchmark_Timer();
$timer->start();
$login = 'notsolonely21';
$dao = new Dao($db_type, 'db.yaml');
$dao->connect();
$dao->find('users', 'login', $login, '=');
$dao->close();
$timer->setMarker('Test_Code_Partition');
echo "Elapsed time between Start and Test_Code_Partition: " . $timer->timeElapsed('Start', 'Test_Code_Partition') . "\n";
// use backend partition
$dao2 = new Dao($db_type, 'db.yaml');
$dao2->connect();
$dao2->find('users', 'login', $login, '=', 'mysql');
$dao2->close();
$timer->setMarker('DB_Partition');
echo "Elapsed time between Test_Code_Partition and DB_Partition: " . $timer->timeElapsed('Test_Code_Partition', 'DB_Partition') . "\n";
// use no partition
$dao3 = new Dao($db_type, 'db.yaml');
$dao3->connect();
$dao3->find('users', 'login', $login, '=', 'nopart');
$dao3->close();
$timer->setMarker('No_Partition');
echo "Elapsed time between DB_Partition and No_Partition: " . $timer->timeElapsed('DB_Partition', 'No_Partition') . "\n";
$timer->stop();
$timer->display();