1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ChatType.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Socialnetwork\Collab\Integration\IM;
6
7use Bitrix\Main\Loader;
8use Bitrix\Socialnetwork\Item\Workgroup\Type;
9
11{
12 public static function getChatTypeByGroupType(Type $type): string
13 {
14 return match ($type) {
15 Type::Collab => self::getCollabType(),
16 default => self::getChatType(),
17 };
18 }
19
20 public static function getChatType(): string
21 {
22 if (!self::isAvailable())
23 {
24 return '';
25 }
26
27 return \Bitrix\Im\V2\Chat::IM_TYPE_CHAT;
28 }
29
30 private static function isAvailable(): bool
31 {
32 return Loader::includeModule('im');
33 }
34
35 public static function getCollabType(): string
36 {
37 if (!self::isAvailable())
38 {
39 return '';
40 }
41
42 return \Bitrix\Im\V2\Chat::IM_TYPE_COLLAB;
43 }
44}
$type
Определения options.php:106
static getChatTypeByGroupType(Type $type)
Определения ChatType.php:12
Определения collection.php:2