- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/counter/monitor.php
- Класс: Bitrix\Crm\Counter\Monitor
- Вызов: Monitor::resetCounters
protected function resetCounters(
int $entityTypeId,
array $counterTypeIds,
?int $responsibleId,
?int $categoryId
): void
{
if (empty($counterTypeIds) || !$responsibleId)
{
return;
}
$extras = [];
if (!is_null($categoryId))
{
$extras['CATEGORY_ID'] = $categoryId;
}
// $counterCodes = EntityCounterManager::prepareCodes(\CCrmOwnerType::Activity, EntityCounterType::CURRENT);
$counterCodes = EntityCounterManager::prepareCodes(
$entityTypeId,
$counterTypeIds,
$extras
);
if(!empty($counterCodes))
{
EntityCounterManager::reset($counterCodes, [$responsibleId]);
EntityCounterManager::resetExcludeUsersCounters($counterCodes, [$responsibleId]);
}
}