Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
PinMessages.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Sync\Entity
;
4
5
use
Bitrix\Im\V2\Link\Pin\PinCollection
;
6
use
Bitrix\Im\V2\Rest\RestAdapter
;
7
use
Bitrix\Im\V2\Sync\Entity
;
8
use
Bitrix\Im\V2\Sync\Event
;
9
10
class
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
{
20
case
Event::DELETE_EVENT
:
21
$this->deletedPinIds[$entityId] = $entityId;
22
break
;
23
case
Event::ADD_EVENT
:
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
}
Bitrix\Im\V2\Link\Pin\PinCollection
Definition
PinCollection.php:24
Bitrix\Im\V2\Rest\RestAdapter
Definition
RestAdapter.php:6
Bitrix\Im\V2\Sync\Entity\PinMessages
Definition
PinMessages.php:11
Bitrix\Im\V2\Sync\Entity\PinMessages\add
add(Event $event)
Definition
PinMessages.php:15
Bitrix\Im\V2\Sync\Entity\PinMessages\getData
getData()
Definition
PinMessages.php:29
Bitrix\Im\V2\Sync\Event
Definition
Event.php:9
Bitrix\Im\V2\Sync\Event\DELETE_EVENT
const DELETE_EVENT
Definition
Event.php:10
Bitrix\Im\V2\Sync\Event\ADD_EVENT
const ADD_EVENT
Definition
Event.php:12
Bitrix\Im\V2\Sync\Entity
Definition
Entity.php:6
Bitrix\Im\V2\Sync\Entity
Definition
Chats.php:3
modules
im
lib
V2
Sync
Entity
PinMessages.php
Создано системой
1.10.0