• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/component/itemlist.php
  • Класс: Bitrix\Crm\Component\ItemList
  • Вызов: ItemList::getCounterValue
private function getCounterValue(?int $categoryId = null): int
{
	$extras = [];
	if ($categoryId !== null)
	{
		$extras['CATEGORY_ID'] = $categoryId;
	}

	$totalCounter = EntityCounterFactory::create(
		$this->factory->getEntityTypeId(),
		EntityCounterType::ALL,
		Container::getInstance()->getUserPermissions()->getUserId(),
		$extras
	);
	return (int)$totalCounter->getValue();
}