• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/restriction/bitrix24searchlimitrestriction.php
  • Класс: Bitrix\Crm\Restriction\Bitrix24SearchLimitRestriction
  • Вызов: Bitrix24SearchLimitRestriction::calculateLimitWarningValue
protected function calculateLimitWarningValue(int $notifiedCount, int $count, int $limit): int
{
	if ($count > $limit)
	{
		return 0;
	}

	$thresholds = [50, 100];
	if ($notifiedCount < $count)
	{
		foreach ($thresholds as $threshold)
		{
			$notificationLimit = $limit - $threshold;
			if ($notificationLimit <= 0)
			{
				continue;
			}

			if ($count > $notificationLimit && $notifiedCount < $notificationLimit)
			{
				return $notificationLimit;
			}
		}
	}

	return 0;
}