• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/config/state.php
  • Класс: Bitrix\Crm\Config\State
  • Вызов: State::getProductLimitState
static function getProductLimitState(?int $iblockId = null): ?array
{
	if (
		$iblockId === null
		&& Loader::includeModule('catalog')
	)
	{

		$iblockId = Crm\Product\Catalog::getDefaultId();
	}

	if ($iblockId === null || $iblockId <= 0)
	{
		return null;
	}

	if (!ModuleManager::isModuleInstalled('bitrix24'))
	{
		return null;
	}

	if (!self::checkIblockId($iblockId))
	{
		return null;
	}

	return [
		'LIMIT_NAME' => Feature::getProductLimitVariable(),
		'LIMIT_VALUE' => Feature::getProductLimit(),
		'CURRENT_VALUE' => self::getElementCount($iblockId),
	];
}