- Модуль: tasksmobile
- Путь к файлу: ~/bitrix/modules/tasksmobile/lib/Controller/Task/Counter.php
- Класс: BitrixTasksMobileControllerTaskCounter
- Вызов: Counter::getAction
public function getAction(int $userId = 0, array $counterTypes = []): array
{
$userId = ($userId ?: CurrentUser::get()->getId());
$counterProvider = InternalsCounter::getInstance($userId);
if (empty($counterTypes))
{
$counterTypes = [
CounterDictionary::COUNTER_SONET_TOTAL_EXPIRED,
CounterDictionary::COUNTER_SONET_TOTAL_COMMENTS,
CounterDictionary::COUNTER_SONET_FOREIGN_EXPIRED,
CounterDictionary::COUNTER_SONET_FOREIGN_COMMENTS,
CounterDictionary::COUNTER_SCRUM_TOTAL_COMMENTS,
CounterDictionary::COUNTER_SCRUM_FOREIGN_COMMENTS,
];
}
$counters = [];
foreach ($counterTypes as $type)
{
$counters[$type] = $counterProvider->get($type);
}
return $this->convertKeysToCamelCase($counters);
}