• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/counter/counterstate.php
  • Класс: BitrixTasksInternalsCounterCounterState
  • Вызов: CounterState::updateState
public function updateState(array $rawCounters, array $types = [], array $taskIds = []): void
{
	if (empty($taskIds) && empty($types))
	{
		$this->state = [];
	}
	foreach ($this->state as $k => $row)
	{
		if (
			!empty($taskIds)
			&& !in_array($row['TASK_ID'], $taskIds)
		)
		{
			continue;
		}

		if (
			!empty($types)
			&& !in_array($row['TYPE'], $types)
		)
		{
			continue;
		}
		unset($this->state[$k]);
	}
	foreach ($rawCounters as $k => $row)
	{
		if (is_null($row))
		{
			unset($rawCounters[$k]);
		}
	}

	$this->state = array_merge($this->state, $rawCounters);

	$this->updateRawCounters();
}