- Модуль: crmmobile
- Путь к файлу: ~/bitrix/modules/crmmobile/lib/Kanban/Entity.php
- Класс: BitrixCrmMobileKanbanEntity
- Вызов: Entity::getCounters
public function getCounters(int $userId, ?int $categoryId): array
{
if (
method_exists(CounterSettings::class, 'getInstance')
&& !CounterSettings::getInstance()->isEnabled()
)
{
return [];
}
$entityTypeId = $this->getEntityTypeId();
$factory = Container::getInstance()->getFactory($entityTypeId);
$data = [];
if (!$factory || !$factory->isCountersEnabled())
{
return $data;
}
$extra = [];
if ($categoryId !== null && $factory->isCategoriesEnabled())
{
$extra['CATEGORY_ID'] = $categoryId;
}
$this->fillCountersData($data, $userId, $extra);
// @todo remove after creating view mode Activity in the mobile
$data[] = [
'typeId' => '999',
'typeName' => 'MY_PENDING',
'code' => 'my_pending',
'value' => 0,
'excludeUsers' => false,
];
if ($this->canUseOtherCounters($categoryId))
{
$extra['EXCLUDE_USERS'] = true;
$this->fillCountersData($data, $userId, $extra);
}
return $data;
}