1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
MessagesAutoDeleteConfigs.php
См. документацию.
1<?php
2
4
7
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}
static getInstance()
Определения application.php:98
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$option
Определения options.php:1711