1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
groupservice.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Integration\SocialNetwork;
4
5use Bitrix\Main\Loader;
6use Bitrix\Socialnetwork\Internals\Registry\GroupRegistry;
7use Bitrix\Socialnetwork\Item\Workgroup;
8
9final class GroupService
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 getGroup(int $id): ?Workgroup
21 {
22 if (!$this->isAvailable())
23 {
24 return null;
25 }
26
27 return GroupRegistry::getInstance()->get($id);
28 }
29
30 public function getAvatar(int $imageId): ?array
31 {
32 if (!$this->isAvailable())
33 {
34 return null;
35 }
36
37 return (new AvatarService())->getAvatar($imageId)->toArray();
38 }
39
40 private function isAvailable(): bool
41 {
42 return Loader::includeModule('socialnetwork');
43 }
44
45 private function __construct()
46 {
47 }
48}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804