本文整理匯總了PHP中DAO::findByQueryWithMetaFields方法的典型用法代碼示例。如果您正苦於以下問題:PHP DAO::findByQueryWithMetaFields方法的具體用法?PHP DAO::findByQueryWithMetaFields怎麽用?PHP DAO::findByQueryWithMetaFields使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DAO
的用法示例。
在下文中一共展示了DAO::findByQueryWithMetaFields方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: findAll
public function findAll($qbuilder)
{
if (UserSession::getInstance()->getAccessLevel() < 3) {
die("<h1>Forbidden resource for you.</h1>");
}
@($dao = new DAO(Test));
if (!isset($qbuilder)) {
$qbuilder = new QueryBuilder('test');
$qbuilder->addOrder("dsc_code", QueryBuilder::$ASC, 'discipline');
$qbuilder->addOrder("tst_title", QueryBuilder::$ASC);
}
$qbuilder->addJoin("discipline", "tst_dsc_id", "dsc_id");
$qbuilder->addLeftJoin("testproblems", "tst_id", "tpb_tst_id");
$qbuilder->addGroupBy("tst_id", "test");
$tests = $dao->findByQueryWithMetaFields($qbuilder);
return $tests;
}
示例2: findAll
public function findAll($qbuilder)
{
if (UserSession::getInstance()->getAccessLevel() < 3) {
die("<h1>Forbidden resource for you.</h1>");
}
@($dao = new DAO(Problem));
if (!isset($qbuilder)) {
$qbuilder = new QueryBuilder('problem');
$qbuilder->addOrder("dsc_code", QueryBuilder::$ASC, 'discipline');
$qbuilder->addOrder("prb_difficultyLevel", QueryBuilder::$ASC);
$qbuilder->addOrder("prb_title", QueryBuilder::$ASC);
}
$qbuilder->addJoin("discipline", "prb_dsc_id", "dsc_id");
$qbuilder->addLeftJoin("evaluationcase", "prb_id", "evc_prb_id");
$qbuilder->addGroupBy("prb_id", "problem");
$problems = $dao->findByQueryWithMetaFields($qbuilder);
return $problems;
}