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