EntityCounterFactory::createCustomSectionCounter

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityCounterFactory
  4. createCustomSectionCounter
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/entitycounterfactory.php
  • Класс: Bitrix\Crm\Counter\EntityCounterFactory
  • Вызов: EntityCounterFactory::createCustomSectionCounter
static function createCustomSectionCounter(string $code, int $userID): AggregateCounter
{
	$settings = CustomSectionProvider::getPagesSettingsByCustomSectionCounterId($code);
	$data = [];
	foreach ($settings as $setting)
	{
		$entityTypeID = CustomSectionProvider::getEntityTypeByPageSetting($setting);

		if(!\CCrmOwnerType::IsDefined($entityTypeID))
		{
			continue;
		}

		$data[] = [
			'entityTypeID' => CustomSectionProvider::getEntityTypeByPageSetting($setting),
			'counterTypeID' => EntityCounterType::ALL,
		];
	}

	return new AggregateCounter($code, $data, $userID);
}

Добавить комментарий