• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/integration/wizards/portal/ids.php
  • Класс: BitrixIntranetIntegrationWizardsPortalIds
  • Вызов: Ids::getBlogId
static function getBlogId(?string $siteId = null): ?string
{
	$siteId = $siteId ?: SITE_ID;

	if (empty(self::$blogs))
	{
		$cacheId = 'blogId';
		$val = self::getFormCache($cacheId);

		if (!is_array($val) && MainLoader::IncludeModule('blog'))
		{
			$val = [];
			$dbGroup = CBlogGroup::GetList(["ID" => "ASC"], ["~NAME" => "[__]%"], false, false, ['ID', 'SITE_ID']);
			while ($res = $dbGroup->Fetch())
			{
				$val[$res['SITE_ID']] = $res['ID'];
			}
			self::putIntoCache($cacheId, $val);
		}
		self::$blogs = $val;
	}
	return isset(self::$blogs[$siteId]) ? (string) self::$blogs[$siteId] : null;
}