EntityCounterSettings::getComponentsOfAllCounter

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityCounterSettings
  4. getComponentsOfAllCounter
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/entitycountersettings.php
  • Класс: Bitrix\Crm\Counter\EntityCounterSettings
  • Вызов: EntityCounterSettings::getComponentsOfAllCounter
public function getComponentsOfAllCounter(): array
{
	$result = [];
	$currentTypeIdIsEnabled = in_array(
		\Bitrix\Crm\Counter\EntityCounterType::CURRENT,
		$this->getEnabledCountersTypes()
	);
	foreach ($this->getEnabledCountersTypes() as $typeId)
	{
		if ($typeId === \Bitrix\Crm\Counter\EntityCounterType::ALL)
		{
			continue;
		}
		if (
			$typeId === \Bitrix\Crm\Counter\EntityCounterType::OVERDUE
			&& $currentTypeIdIsEnabled
		)
		{
			continue;
		}
		if (
			$typeId === \Bitrix\Crm\Counter\EntityCounterType::PENDING
			&& $currentTypeIdIsEnabled
		)
		{
			continue;
		}

		$result[] = $typeId;
	}

	return $result;
}

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