当前位置: 首页>>代码示例>>PHP>>正文


PHP LanguageManager::getLanguageById方法代码示例

本文整理汇总了PHP中LanguageManager::getLanguageById方法的典型用法代码示例。如果您正苦于以下问题:PHP LanguageManager::getLanguageById方法的具体用法?PHP LanguageManager::getLanguageById怎么用?PHP LanguageManager::getLanguageById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LanguageManager的用法示例。


在下文中一共展示了LanguageManager::getLanguageById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: intval

<?php

include_once 'config.php';
require_once BUSINESS_DIR_TRANSLREQ . 'TranslationRequestManager.php';
require_once BUSINESS_DIR_TRANSLREQ . 'TranslationRequest.php';
require_once BUSINESS_DIR_LANG . 'LanguageManager.php';
date_default_timezone_set('America/Toronto');
$userid = intval($_GET['u']);
$entryid = intval($_GET['e']);
$langid = intval($_GET['l']);
$treq = new TranslationRequest();
$trm = new TranslationRequestManager();
$lm = new LanguageManager();
$treqLang = $lm->getLanguageById($langid);
// check if a treq for that entry for that language already exists
$existingTreqs = $trm->getListOfTreqByEntryIdAndLangId($entryid, $langid);
if (sizeof($existingTreqs) <= 1) {
    // if there's just an empty array element
    $treq->setTreqCreatorId($userid);
    $treq->setTreqEntryId($entryid);
    $treq->setTreqLang($langid);
    $treq->setTreqDate(date('Y-m-d'));
    //var_dump($treq);
    $treq_id = $trm->createTreq($treq);
    //echo "<br>treq_id " . $treq_id;
    $treqbrief = $trm->getTreqBriefById($treq_id);
    //var_dump($treqbrief);
    echo "<span id='treqResp'><b>" . $treqbrief[0]->getTreqLang() . "</b> translation requested</span>";
} else {
    echo "<span id='treqResp'><mark>" . "Sorry, a request for <b>" . $treqLang->getLangName() . "</b> was already created on " . $existingTreqs[0]->getTreqDate() . "</mark></span>";
}
开发者ID:lilyfan,项目名称:Tarboz,代码行数:31,代码来源:treqCreate.php


注:本文中的LanguageManager::getLanguageById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。