• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/classes/general/user_counter.php
  • Класс: CAllUserCounter
  • Вызов: CAllUserCounter::getValuesForCache
static function getValuesForCache(array $counters = []): array
{
	$cachedCounters = [];

	foreach ($counters as $counter)
	{
		$key = $counter['CODE'] . '_' . $counter['SITE_ID'];

		if (!isset($cachedCounters[$key]))
		{
			$cachedCounters[$key] = $counter;
			$cachedCounters[$key]['CNT'] = (int)$counter['CNT'];
		}
		else
		{
			$cachedCounters[$key]['CNT'] += (int)$counter['CNT'];
			if (isset($counter['LAST_DATE_TS']))
			{
				$cachedCounters[$key]['LAST_DATE_TS'] = $counter['LAST_DATE_TS'];
			}
		}
	}

	return array_values($cachedCounters);
}