MonitorByActResponsible::processActivityBindingsChanges

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. MonitorByActResponsible
  4. processActivityBindingsChanges
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/monitor/monitorbyactresponsible.php
  • Класс: Bitrix\Crm\Counter\Monitor\MonitorByActResponsible
  • Вызов: MonitorByActResponsible::processActivityBindingsChanges
protected function processActivityBindingsChanges(): void
{
	$affectedBindings = array_values($this->activitiesBindingsChanges);

	$entitiesData = $this->loadEntitiesDataForBindings($affectedBindings);

	$responsible = $this->loadActivityResponsibleIds($affectedBindings);


	foreach ($affectedBindings as $binding)
	{
		$entityData = $entitiesData[$binding->getEntityTypeId()][$binding->getEntityId()] ?? [];

		if (!isset($responsible[$binding->getHash()]))
		{
			continue;
		}

		$responsibleIds = $responsible[$binding->getHash()];

		foreach ($responsibleIds as $responsibleId)
		{
			$this->resetCounters(
				$binding->getEntityTypeId(),
				EntityCounterType::getAll(true),
				$responsibleId,
				$entityData['categoryId'] ?? null,
			);
		}
	}
}

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