1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
counterprovider.php
См. документацию.
1<?php
2
4
8use Bitrix\Tasks\Internals\Counter;
9
11{
12 public function __construct(private int $userId) { }
13
14 public function getTotal(int $spaceId = 0): int
15 {
16 $result = 0;
17
18 if (!$this->isTasksModuleAvailable())
19 {
20 return $result;
21 }
22
23 return Counter::getInstance($this->userId)->get(Counter\CounterDictionary::COUNTER_MEMBER_TOTAL, $spaceId);
24 }
25
26 public function getValue(int $spaceId = 0, array $metrics = []): int
27 {
28 $result = 0;
29
30 if (!$this->isTasksModuleAvailable())
31 {
32 return $result;
33 }
34
35 foreach ($metrics as $metric)
36 {
37 switch ($metric)
38 {
39 case Dictionary::COUNTERS_TASKS_TOTAL:
40 return $this->getTotal($spaceId);
41 //TODO: other cases...
42 }
43 }
44
45 return $result;
46 }
47
48 public function getAvailableMetrics(): array
49 {
50 return [
51 Dictionary::COUNTERS_TASKS_TOTAL,
52 ];
53 }
54
55 private function isTasksModuleAvailable(): bool
56 {
57 return Loader::includeModule('tasks');
58 }
59}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
Определения loader.php:13
getValue(int $spaceId=0, array $metrics=[])
Определения counterprovider.php:26
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14