• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/config/state.php
  • Класс: Bitrix\Crm\Config\State
  • Вызов: State::getElementCount
static function getElementCount(int $iblockId): int
{
	if (self::$elementCount === null)
	{
		self::$elementCount = 0;
		if (Loader::includeModule('iblock'))
		{
			self::$elementCount = Iblock\ElementTable::getCount(
				[
					'=IBLOCK_ID' => $iblockId,
					'=WF_STATUS_ID' => 1,
					'==WF_PARENT_ELEMENT_ID' => null,
				],
				[
					'ttl' => 86400,
				]
			);
		}
	}
	return self::$elementCount;
}