0 && $cache->InitCache($cache_time, $cache_id, $cache_path)) { $res = $cache->GetVars(); if (is_array($res["iblocksByCode"]) && (count($res["iblocksByCode"]) > 0)) $iblocksByCode = $res["iblocksByCode"]; } if (empty($iblocksByCode)) { $rsIBlocks = \CIBlock::GetList( Array(), Array( "SITE_ID" => SITE_ID, ) ); global $CACHE_MANAGER; $CACHE_MANAGER->StartTagCache($cache_path); while ($arIBlock = $rsIBlocks->Fetch()) { $CACHE_MANAGER->RegisterTag("iblock_id_".$arIBlock["ID"]); $iblocksByCode[$arIBlock['CODE']] = $arIBlock['ID']; } $CACHE_MANAGER->RegisterTag("iblock_id_new"); $CACHE_MANAGER->EndTagCache(); if ($cache_time > 0) { $cache->StartDataCache($cache_time, $cache_id, $cache_path); $cache->EndDataCache(array("iblocksByCode" => $iblocksByCode)); } } self::$byCode = $iblocksByCode; } }