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