当前位置: 首页>>代码示例>>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;未经允许,请勿转载。