Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
secretary.php
1
<?php
2
namespace
Bitrix\Im\Integration
;
3
4
use
Bitrix\Im\Alias
;
5
use
Bitrix\Im\Call\Conference
;
6
use
Bitrix\Main\Error
;
7
use
Bitrix\Main\Localization\Loc
;
8
use
Bitrix\Main\Result
;
9
10
class
Secretary
11
{
20
public
static
function
createChat
(array $fields = []):
Result
21
{
22
$result =
new
Result
();
23
24
$chat = new \CIMChat(0);
25
$chatId = $chat->Add(
26
[
27
'USERS'
=> $fields[
'USERS'
] ??
false
,
28
'TITLE'
=> $fields[
'TITLE'
] ??
''
,
29
'MESSAGE'
=> $fields[
'MESSAGE'
] ??
false
30
]
31
);
32
33
if
(!$chatId)
34
{
35
return
$result->addError(
new
Error
(
Loc::getMessage
(
'IM_INT_SECRETARY_CHAT_CREATION_ERROR'
)));
36
}
37
38
$result->setData([
'CHAT_ID'
=> $chatId]);
39
40
return
$result;
41
}
42
43
public
static
function
createCall
(array $users = [],
string
$title =
''
)
44
{
45
//todo
46
}
47
55
public
static
function
createConference
(array $fields = []):
Result
56
{
57
$result =
new
Result
();
58
59
$aliasData =
Alias::addUnique
(
60
[
61
"ENTITY_TYPE"
=>
Alias::ENTITY_TYPE_VIDEOCONF
,
62
"ENTITY_ID"
=> 0
63
]
64
);
65
66
$creationResult =
Conference::add
(
67
[
68
'USERS'
=> $fields[
'USERS'
] ?? [],
69
'TITLE'
=> $fields[
'TITLE'
] ??
''
,
70
'ALIAS_DATA'
=> $aliasData
71
]
72
);
73
74
if
(!$creationResult->isSuccess())
75
{
76
return
$result->addErrors($creationResult->getErrors());
77
}
78
79
$result->setData([
'ALIAS_DATA'
=> $aliasData]);
80
81
return
$result;
82
}
83
}
Bitrix\Im\Alias
Definition
alias.php:8
Bitrix\Im\Alias\ENTITY_TYPE_VIDEOCONF
const ENTITY_TYPE_VIDEOCONF
Definition
alias.php:13
Bitrix\Im\Alias\addUnique
static addUnique(array $fields)
Definition
alias.php:55
Bitrix\Im\Call\Conference
Definition
conference.php:26
Bitrix\Im\Call\Conference\add
static add(array $fields=[])
Definition
conference.php:730
Bitrix\Im\Integration\Secretary
Definition
secretary.php:11
Bitrix\Im\Integration\Secretary\createCall
static createCall(array $users=[], string $title='')
Definition
secretary.php:43
Bitrix\Im\Integration\Secretary\createChat
static createChat(array $fields=[])
Definition
secretary.php:20
Bitrix\Im\Integration\Secretary\createConference
static createConference(array $fields=[])
Definition
secretary.php:55
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\Im\Integration
modules
im
lib
integration
secretary.php
Создано системой
1.10.0