EntityCounterManager::resetExcludeUsersCounters

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityCounterManager
  4. resetExcludeUsersCounters
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/counter/entitycountermanager.php
  • Класс: Bitrix\Crm\Counter\EntityCounterManager
  • Вызов: EntityCounterManager::resetExcludeUsersCounters
static function resetExcludeUsersCounters(array $codes, array $userIds): void
{
	$codes = array_unique($codes);
	$resetForDefiniteUser = count($userIds) === 1;
	$excludeCodes = [];
	foreach ($codes as $code)
	{
		$excludeCodes[] = self::convertCodeToExcluded($code);
	}
	foreach($userIds as $userId)
	{
		foreach($excludeCodes as $code)
		{
			$resetForDefiniteUser
				? EntityCounter::resetExcludedByCode($code, $userId)
				: EntityCounter::resetByCodeForAll($code)
			;
		}
	}
}

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