Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
secretary.php
1<?php
3
9
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}
const ENTITY_TYPE_VIDEOCONF
Definition alias.php:13
static addUnique(array $fields)
Definition alias.php:55
static add(array $fields=[])
static createCall(array $users=[], string $title='')
Definition secretary.php:43
static createChat(array $fields=[])
Definition secretary.php:20
static createConference(array $fields=[])
Definition secretary.php:55
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29