• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/restriction/site.php
  • Класс: BitrixLandingRestrictionSite
  • Вызов: Site::isFreeDomainAllowed
static function isFreeDomainAllowed(string $code, array $params): bool
{
	// free domain is available in cloud version only
	if (!Loader::includeModule('bitrix24'))
	{
		return false;
	}

	$availableCount = Feature::getVariable(
		'landing_free_domain'
	);
	if ($availableCount === null)
	{
		return false;
	}
	if (($params['trueOnNotNull'] ?? false))
	{
		return true;
	}
	if ($availableCount > 0)
	{
		$check = Domain::getList([
			'select' => [
				'CNT' => new EntityExpressionField('CNT', 'COUNT(*)')
			],
			'filter' => [
				'!PROVIDER' => null
			],
			'group' => []
		])->fetch();
		if ($check && $check['CNT'] >= $availableCount)
		{
			return false;
		}
	}
	return true;
}