• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/v2/Integration/Landing/StoreV3Master.php
  • Класс: BitrixCatalogv2IntegrationLandingStoreV3Master
  • Вызов: StoreV3Master::getStoreId
static function getStoreId(): ?int
{
	if (self::$storeId === null)
	{
		if (!Loader::includeModule('landing'))
		{
			return null;
		}

		Rights::setGlobalOff();

		$result = Site::getList([
			'select' => ['ID'],
			'filter' => ['=TPL_CODE' => self::STORE_ID],
			'order' => ['ID' => 'desc'],
			'limit' => 1,
		]);
		if ($store = $result->fetch())
		{
			self::$storeId = (int)$store['ID'];
		}

		Rights::setGlobalOn();
	}

	return self::$storeId;
}