• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/report/limit.php
  • Класс: Bitrix\Crm\Integration\Report\Limit
  • Вызов: Limit::getEntityCounts
static function getEntityCounts(bool $staticCache = true): array
{
	if (!$staticCache || static::$entityCounts === null)
	{
		foreach (self::LIMITATION_MAP as $entityTypeId => $info)
		{
			$entityTypeIdLower = mb_strtolower($entityTypeId);
			$maxCount = Feature::getVariable($info['var']) ?? 0;
			$actualCount =
				(class_exists($info['class']) && is_callable("{$info['class']}::GetTotalCount"))
					? call_user_func("{$info['class']}::GetTotalCount")
					: 0
			;
			static::$entityCounts[$entityTypeIdLower] = [
				'actualCount' => $actualCount,
				'maxCount' => $maxCount
			];
		}
	}

	return static::$entityCounts;
}