本文整理汇总了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;
}