1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
legacycounterprovider.php
См. документацию.
1<?php
2
3namespace Bitrix\Socialnetwork\Integration\SocialNetwork\LiveFeed;
4
5use Bitrix\Socialnetwork\Internals\Space\Counter\Dictionary;
6use Bitrix\Socialnetwork\Internals\Space\Counter\ProviderInterface;
7
9{
10 public function __construct(private int $userId) { }
11
12 public function getTotal(int $spaceId = 0): int
13 {
14 if ($spaceId === 0)
15 {
16 return \CUserCounter::GetValueByUserID($this->userId, SITE_ID, \CUserCounter::LIVEFEED_CODE);
17 }
18
19 // group livefeed
20 return 0;
21 }
22
23 public function getValue(int $spaceId = 0, array $metrics = []): int
24 {
25 $result = 0;
26
27 foreach ($metrics as $metric)
28 {
29 switch ($metric)
30 {
31 case Dictionary::COUNTERS_LIVEFEED_TOTAL:
32 return $this->getTotal($spaceId);
33 //TODO: other cases...
34 }
35 }
36
37 return $result;
38 }
39
40 public function getAvailableMetrics(): array
41 {
42 return [
43 Dictionary::COUNTERS_LIVEFEED_TOTAL,
44 ];
45 }
46}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
</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
const SITE_ID
Определения sonet_set_content_view.php:12