• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/monitor/activitychange.php
  • Класс: Bitrix\Crm\Counter\Monitor\ActivityChange
  • Вызов: ActivityChange::getAffectedCounterTypes
public function getAffectedCounterTypes(bool $withResponsible = false): array
{
	$isIncomingChannelChanged = $this->isIncomingChannelChanged();
	$isDeadlineChanged = $this->isDeadlineChanged();
	$isLightTimeChanged = $this->isLightTimeChanges();
	$isResponsibleChange = $this->isResponsibleIdChanged();

	$affectedTypeIds = [];
	if (
		($isDeadlineChanged && $isIncomingChannelChanged)
		|| ($isLightTimeChanged && $isIncomingChannelChanged)
		|| $this->isCompletedChanged()
		|| $this->areBindingsChanged()
	)
	{
		$affectedTypeIds = EntityCounterType::getAll(true);
	}
	elseif ($isResponsibleChange && $withResponsible)
	{
		$affectedTypeIds = EntityCounterType::getAll(true);
	}
	elseif ($isDeadlineChanged)
	{
		$affectedTypeIds = EntityCounterType::getAllDeadlineBased(true);
	}
	elseif ($isLightTimeChanged)
	{
		$affectedTypeIds = EntityCounterType::getAllLightTimeBased(true);
	}
	elseif ($isIncomingChannelChanged)
	{
		$affectedTypeIds = EntityCounterType::getAllIncomingBased(true);
	}

	return $affectedTypeIds;
}