• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/restriction/bitrix24searchlimitrestriction.php
  • Класс: Bitrix\Crm\Restriction\Bitrix24SearchLimitRestriction
  • Вызов: Bitrix24SearchLimitRestriction::getLimitWarningValue
public function getLimitWarningValue(int $entityTypeId, int $userId = null): int
{
	if ($userId === null)
	{
		$userId = Container::getInstance()->getContext()->getUserId();
	}

	if (!$userId)
	{
		return 0;
	}

	$limit = $this->getQuantityLimit();
	if ($limit <= 0)
	{
		return 0;
	}

	if (Bitrix24Manager::hasPurchasedLicense())
	{
		return 0;
	}

	return $this->calculateLimitWarningValue(
		$this->getUserNotifiedCount($entityTypeId, $userId),
		$this->getCount($entityTypeId),
		$limit
	);
}