Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Messages.php
1<?php
2
4
9
10class Messages implements Entity
11{
12 private array $messageIds = [];
13 private array $completeDeletedMessageIds = [];
14
15 public function add(Event $event): void
16 {
17 $entityId = $event->entityId;
18 switch ($event->eventName)
19 {
21 $this->completeDeletedMessageIds[$entityId] = $entityId;
22 break;
25 $this->messageIds[$entityId] = $entityId;
26 break;
27 }
28 }
29
30 public function getData(): array
31 {
32 $fullMessage = new MessageCollection($this->messageIds);
33
34 return [
35 'messages' => (new RestAdapter($fullMessage))->toRestFormat(),
36 'completeDeletedMessages' => $this->completeDeletedMessageIds,
37 ];
38 }
39}
const COMPLETE_DELETE_EVENT
Definition Event.php:11