19 $this->loader = $loader;
24 public function init(): void
26 $this->counters = $this->getCountersEmptyState();
27 $this->loadCounters();
32 return $this->counters[$metaProp] ?? [];
35 private function loadCounters(): void
38 foreach ($this->loader->getRawCounters() as
$counter)
41 $parentId = (int)
$counter[
'PARENT_ID'];
45 $categoryIds[] = $parentId;
49 $mutedCategories = $this->muteProvider->getByCategoryIds($categoryIds);
51 foreach ($this->loader->getRawCounters() as
$counter)
55 $eventId = (int)
$counter[
'EVENT_ID'];
56 $parentId = (int)
$counter[
'PARENT_ID'];
63 $this->counters[$openEventMetaProp][
'category'][$parentId] ??= 0;
64 $this->counters[$openEventMetaProp][
'category'][$parentId] += $value;
67 $isMuted = $mutedCategories[$parentId] ??
false;
70 $this->counters[$openEventMetaProp][
'total'] += $value;
79 private function getCountersEmptyState():
array