1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
PinMessages.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Sync\Entity;
4
5use Bitrix\Im\V2\Link\Pin\PinCollection;
6use Bitrix\Im\V2\Sync\Entity;
7use Bitrix\Im\V2\Sync\Event;
8
9class PinMessages implements Entity
10{
11 private array $pinIds = [];
12 private array $deletedPinIds = [];
13 private PinCollection $pins;
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
30 {
31 $this->pins ??= new PinCollection($this->pinIds);
32
33 return $this->pins;
34 }
35
36 public static function getRestEntityName(): string
37 {
38 return 'pinSync';
39 }
40
41 public function toRestFormat(array $option = []): ?array
42 {
43 return [
44 'addedPins' => $this->pinIds,
45 'deletedPins' => $this->deletedPinIds,
46 ];
47 }
48}
static getRestEntityName()
Определения PinMessages.php:36
toRestFormat(array $option=[])
Определения PinMessages.php:41
add(Event $event)
Определения PinMessages.php:15
const DELETE_EVENT
Определения Event.php:10
const ADD_EVENT
Определения Event.php:12
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
Определения ufield.php:9
$entityId
Определения payment.php:4
$event
Определения prolog_after.php:141
$option
Определения options.php:1711