本文整理匯總了PHP中CIBlockType::_GetCache方法的典型用法代碼示例。如果您正苦於以下問題:PHP CIBlockType::_GetCache方法的具體用法?PHP CIBlockType::_GetCache怎麽用?PHP CIBlockType::_GetCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CIBlockType
的用法示例。
在下文中一共展示了CIBlockType::_GetCache方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetByIDLang
/**
* Returns iblock type information with additional language depended messages.<br>
*
* Additional to {@link CIBlockType} language depended fields:
* <ul>
* <li>NAME - Name of the type
* <li>SECTION_NAME - How sections are called
* <li>ELEMENT_NAME - How elements are called
* </ul>
*
* <code>
* if (CModule::IncludeModule('iblock'))
* {
* $rsTypeLang = CIBlockType::GetByIDLang('test', 'en');
* $arTypeLang = $rsTypeLang->GetNext();
* if ($arTypeLang)
* {
* echo '<pre>', htmlspecialcharsEx(print_r($arTypeLang, true)), '</pre>';
* }
* }
* </code>
* @param string $ID iblock type ID
* @param string $LID language ID
* @param bool $bFindAny Forces strict search
* @return array|bool
*/
public static function GetByIDLang($ID, $LID, $bFindAny = true)
{
/** @global CDatabase $DB */
global $DB;
$LID = $DB->ForSQL($LID, 2);
if (CACHED_b_iblock_type === false) {
$strSql = "\n\t\t\t\tSELECT BTL.*, BT.*\n\t\t\t\tFROM b_iblock_type BT, b_iblock_type_lang BTL\n\t\t\t\tWHERE BTL.IBLOCK_TYPE_ID = '" . $DB->ForSQL($ID) . "'\n\t\t\t\tAND BTL.LID='" . $LID . "'\n\t\t\t\tAND BT.ID=BTL.IBLOCK_TYPE_ID\n\t\t\t";
$res = $DB->Query($strSql);
if ($r = $res->GetNext()) {
return $r;
}
} else {
$arResult = CIBlockType::_GetCache($ID);
if ($arResult !== false && array_key_exists($LID, $arResult["_lang"])) {
$res = $arResult["_lang"][$LID];
unset($arResult["_lang"]);
return array_merge($res, $arResult);
}
}
if (!$bFindAny) {
return false;
}
$strSql = "\n\t\t\tSELECT BTL.*, BT.*\n\t\t\tFROM b_iblock_type BT, b_iblock_type_lang BTL, b_language L\n\t\t\tWHERE BTL.IBLOCK_TYPE_ID = '" . $DB->ForSQL($ID) . "'\n\t\t\tAND BTL.LID = L.LID\n\t\t\tAND BT.ID=BTL.IBLOCK_TYPE_ID\n\t\t\tORDER BY L.DEF DESC, L.SORT\n\t\t";
$res = $DB->Query($strSql);
if ($r = $res->GetNext()) {
return $r;
}
return false;
}