1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
usercollabs.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Integration\SocialNetwork\Collab;
4
5use Bitrix\Main\Loader;
6use Bitrix\Socialnetwork\Collab\Provider\CollabProvider;
7use Bitrix\Socialnetwork\Collab\Provider\CollabQuery;
8
9final class UserCollabs
10{
11 private static ?self $instance;
12
13 public static function getInstance(): self
14 {
15 self::$instance ??= new self();
16
17 return self::$instance;
18 }
19
20 public function get(int $userId): array
21 {
22 if (!$this->isAvailable())
23 {
24 return [];
25 }
26
27 return (new CollabProvider())
28 ->getListByUserId($userId, (new CollabQuery())->setSelect(['ID', 'NAME']))
29 ->toArray();
30 }
31
35 public function getIds(int $userId): array
36 {
37 if (!$this->isAvailable())
38 {
39 return [];
40 }
41
42 $ids = (new CollabProvider())->getListByUserId($userId, (new CollabQuery())->setSelect(['ID']))->getIdList();
43
44 return array_map('intval', $ids);
45 }
46
47 private function isAvailable(): bool
48 {
49 return Loader::includeModule('socialnetwork');
50 }
51
52 private function __construct()
53 {
54 }
55}
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