當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Definition::populateFromDbResult方法代碼示例

本文整理匯總了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}"));
}
開發者ID:florinp,項目名稱:dexonline,代碼行數:24,代碼來源:deleteMdnDuplicates.php

示例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);
}
開發者ID:florinp,項目名稱:dexonline,代碼行數:7,代碼來源:fixMFA.php

示例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;
}
開發者ID:florinp,項目名稱:dexonline,代碼行數:15,代碼來源:importMdn.php


注:本文中的Definition::populateFromDbResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。