1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
ChatType.php
См. документацию.
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Socialnetwork\Collab\Integration\IM;
6
7
use Bitrix\Main\Loader;
8
use Bitrix\Socialnetwork\Item\Workgroup\Type;
9
10
class
ChatType
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
$type
Определения
options.php:106
Bitrix\Socialnetwork\Collab\Integration\IM\ChatType
Определения
ChatType.php:11
Bitrix\Socialnetwork\Collab\Integration\IM\ChatType\getChatType
static getChatType()
Определения
ChatType.php:20
Bitrix\Socialnetwork\Collab\Integration\IM\ChatType\getCollabType
static getCollabType()
Определения
ChatType.php:35
Bitrix\Socialnetwork\Collab\Integration\IM\ChatType\getChatTypeByGroupType
static getChatTypeByGroupType(Type $type)
Определения
ChatType.php:12
Bitrix\Main\Type
Определения
collection.php:2
bitrix
modules
socialnetwork
lib
Collab
Integration
IM
ChatType.php
Создано системой
1.14.0