Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ReactionPopupItem.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Message\Reaction
;
4
5
use
Bitrix\Im\V2\Rest\PopupData
;
6
use
Bitrix\Im\V2\Rest\PopupDataAggregatable
;
7
use
Bitrix\Im\V2\Rest\PopupDataItem
;
8
9
class
ReactionPopupItem
implements
PopupDataItem
,
PopupDataAggregatable
10
{
11
private
ReactionMessages
$reactions;
12
16
public
function
__construct
($reactions =
null
)
17
{
18
$reactions ??=
new
ReactionMessages
([],
false
);
19
20
if
($reactions instanceof
ReactionMessages
)
21
{
22
$this->reactions = $reactions;
23
}
24
if
($reactions instanceof
ReactionMessage
)
25
{
26
$this->reactions =
ReactionMessages::initFromArray
([$reactions]);
27
}
28
}
29
30
public
function
merge
(
PopupDataItem
$item): self
31
{
32
if
($item instanceof
self
)
33
{
34
foreach
($item->reactions as $reaction)
35
{
36
$this->reactions->addReactionMessage($reaction);
37
}
38
}
39
40
return
$this;
41
}
42
43
public
static
function
getRestEntityName
(): string
44
{
45
return
'reactions'
;
46
}
47
48
public
function
toRestFormat
(array $option = []): array
49
{
50
return
$this->reactions->toRestFormat($option);
51
}
52
53
public
function
getPopupData
(array $excludedList = []):
PopupData
54
{
55
return
$this->reactions->getPopupData($excludedList);
56
}
57
}
Bitrix\Im\V2\Message\Reaction\ReactionMessage
Definition
ReactionMessage.php:12
Bitrix\Im\V2\Message\Reaction\ReactionMessages
Definition
ReactionMessages.php:21
Bitrix\Im\V2\Message\Reaction\ReactionMessages\initFromArray
static initFromArray(array $reactionArray, bool $withOwnReactions=true)
Definition
ReactionMessages.php:39
Bitrix\Im\V2\Message\Reaction\ReactionPopupItem
Definition
ReactionPopupItem.php:10
Bitrix\Im\V2\Message\Reaction\ReactionPopupItem\getRestEntityName
static getRestEntityName()
Definition
ReactionPopupItem.php:43
Bitrix\Im\V2\Message\Reaction\ReactionPopupItem\toRestFormat
toRestFormat(array $option=[])
Definition
ReactionPopupItem.php:48
Bitrix\Im\V2\Message\Reaction\ReactionPopupItem\getPopupData
getPopupData(array $excludedList=[])
Definition
ReactionPopupItem.php:53
Bitrix\Im\V2\Message\Reaction\ReactionPopupItem\__construct
__construct($reactions=null)
Definition
ReactionPopupItem.php:16
Bitrix\Im\V2\Message\Reaction\ReactionPopupItem\merge
merge(PopupDataItem $item)
Definition
ReactionPopupItem.php:30
Bitrix\Im\V2\Rest\PopupData
Definition
PopupData.php:6
Bitrix\Im\V2\Rest\PopupDataAggregatable
Definition
PopupDataAggregatable.php:10
Bitrix\Im\V2\Rest\PopupDataItem
Definition
PopupDataItem.php:6
Bitrix\Im\V2\Message\Reaction
Definition
PushService.php:3
modules
im
lib
V2
Message
Reaction
ReactionPopupItem.php
Создано системой
1.10.0