本文整理匯總了PHP中Definition::populateFromDbResult方法的典型用法代碼示例。如果您正苦於以下問題:PHP Definition::populateFromDbResult方法的具體用法?PHP Definition::populateFromDbResult怎麽用?PHP Definition::populateFromDbResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Definition
的用法示例。
在下文中一共展示了Definition::populateFromDbResult方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ini_set
<?php
require_once "../../phplib/util.php";
ini_set('max_execution_time', '3600');
assert_options(ASSERT_BAIL, 1);
debug_off();
$mdnSrc = Source::load(21);
$query = "select * from Definition where SourceId = 21 and Status = 0 " . "order by InternalRep, Id";
$defs = Definition::populateFromDbResult(mysql_query($query));
$idsToDelete = array();
foreach ($defs as $i => $d) {
if ($i) {
$prev = $defs[$i - 1];
if (trim($d->internalRep) == trim($prev->internalRep)) {
print "Deleting extra definition for {$prev->lexicon}\n";
$idsToDelete[] = $d->id;
}
}
}
foreach ($idsToDelete as $id) {
assert(mysql_query("delete from Comment where DefinitionId = {$id}"));
assert(mysql_query("delete from LexemDefinitionMap where DefinitionId = {$id}"));
assert(mysql_query("delete from Definition where Id = {$id}"));
}
示例2: loadDefinitions
function loadDefinitions($lexemId)
{
$query = "select Definition.* from Definition, LexemDefinitionMap " . "where Definition.Id = LexemDefinitionMap.DefinitionId " . "and LexemDefinitionMap.LexemId = {$lexemId} " . "and Status = 0 " . "and SourceId in (1,2,3,4,5,17,21)";
// "and SourceId not in (7, 12)";
$dbResult = mysql_query($query);
return Definition::populateFromDbResult($dbResult);
}
示例3: loadExistingMapByLexicon
function loadExistingMapByLexicon()
{
$result = array();
$query = "select * from Definition where SourceId = 21 and Status = 0";
$defs = Definition::populateFromDbResult(mysql_query($query));
foreach ($defs as $def) {
$l = $def->lexicon;
if (array_key_exists($l, $result)) {
$result[$l][] = $def;
} else {
$result[$l] = array($def);
}
}
return $result;
}