1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
MessagesAutoDeleteConfigs.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Im\V2\Chat\MessagesAutoDelete
;
4
5
use
Bitrix\Im\V2\Chat
;
6
use
Bitrix\Im\V2\Rest\PopupDataItem
;
7
8
class
MessagesAutoDeleteConfigs
implements
PopupDataItem
9
{
13
protected
array
$chatIds
= [];
14
protected
bool
$showDefaultValues
=
false
;
15
16
public
function
__construct
(
array
$chatIds
)
17
{
18
$this->chatIds = array_unique(
$chatIds
);
19
}
20
21
public
function
merge
(
PopupDataItem
$item): self
22
{
23
if
($item instanceof
self
)
24
{
25
$this->chatIds = array_unique(array_merge($this->chatIds, $item->chatIds));
26
}
27
28
return
$this;
29
}
30
31
public
function
showDefaultValues
(): self
32
{
33
$this->
showDefaultValues
=
true
;
34
return
$this;
35
}
36
37
public
static
function
getRestEntityName
(): string
38
{
39
return
'messagesAutoDeleteConfigs'
;
40
}
41
42
public
function
toRestFormat
(
array
$option
= []): ?
array
43
{
44
$rest = [];
45
46
foreach
($this->chatIds as $chatId)
47
{
48
$chat =
Chat::getInstance
($chatId);
49
50
if
($this->
showDefaultValues
|| $chat->getMessagesAutoDeleteDelay())
51
{
52
$rest[] = [
53
'delay'
=> $chat->getMessagesAutoDeleteDelay(),
54
'chatId'
=> $chat->getChatId(),
55
];
56
}
57
}
58
59
return
$rest;
60
}
61
}
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs
Определения
MessagesAutoDeleteConfigs.php:9
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs\getRestEntityName
static getRestEntityName()
Определения
MessagesAutoDeleteConfigs.php:37
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs\toRestFormat
toRestFormat(array $option=[])
Определения
MessagesAutoDeleteConfigs.php:42
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs\$chatIds
array $chatIds
Определения
MessagesAutoDeleteConfigs.php:13
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs\showDefaultValues
showDefaultValues()
Определения
MessagesAutoDeleteConfigs.php:31
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs\__construct
__construct(array $chatIds)
Определения
MessagesAutoDeleteConfigs.php:16
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs\$showDefaultValues
bool $showDefaultValues
Определения
MessagesAutoDeleteConfigs.php:14
Bitrix\Im\V2\Chat\MessagesAutoDelete\MessagesAutoDeleteConfigs\merge
merge(PopupDataItem $item)
Определения
MessagesAutoDeleteConfigs.php:21
Bitrix\Main\Application\getInstance
static getInstance()
Определения
application.php:98
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Im\V2\Rest\PopupDataItem
Определения
PopupDataItem.php:6
Bitrix\Im\V2\Chat\MessagesAutoDelete
Определения
MessagesAutoDeleteConfigs.php:3
Bitrix\Im\V2\Chat
$option
$option
Определения
options.php:1711
bitrix
modules
im
lib
V2
Chat
MessagesAutoDelete
MessagesAutoDeleteConfigs.php
Создано системой
1.14.0