Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
UserPopupItem.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Entity\User
;
4
5
use
Bitrix\Im\V2\Rest\PopupDataItem
;
6
7
class
UserPopupItem
implements
PopupDataItem
8
{
12
private
array $userIds;
13
14
public
function
__construct
(array $userIds = [])
15
{
16
$this->userIds = array_unique($userIds);
17
}
18
19
public
function
merge
(
PopupDataItem
$item): self
20
{
21
if
($item instanceof
self
)
22
{
23
$this->userIds = array_unique(array_merge($this->userIds, $item->userIds));
24
}
25
26
return
$this;
27
}
28
29
public
static
function
getRestEntityName
(): string
30
{
31
return
UserCollection::getRestEntityName
();
32
}
33
34
public
function
toRestFormat
(array $option = []): array
35
{
36
return
(
new
UserCollection
(array_unique($this->userIds)))->getUnique()->toRestFormat($option);
37
}
38
}
Bitrix\Im\V2\Entity\User\UserCollection
Definition
UserCollection.php:17
Bitrix\Im\V2\Entity\User\UserCollection\getRestEntityName
static getRestEntityName()
Definition
UserCollection.php:115
Bitrix\Im\V2\Entity\User\UserPopupItem
Definition
UserPopupItem.php:8
Bitrix\Im\V2\Entity\User\UserPopupItem\getRestEntityName
static getRestEntityName()
Definition
UserPopupItem.php:29
Bitrix\Im\V2\Entity\User\UserPopupItem\toRestFormat
toRestFormat(array $option=[])
Definition
UserPopupItem.php:34
Bitrix\Im\V2\Entity\User\UserPopupItem\__construct
__construct(array $userIds=[])
Definition
UserPopupItem.php:14
Bitrix\Im\V2\Entity\User\UserPopupItem\merge
merge(PopupDataItem $item)
Definition
UserPopupItem.php:19
Bitrix\Im\V2\Rest\PopupDataItem
Definition
PopupDataItem.php:6
Bitrix\Im\V2\Entity\User
modules
im
lib
V2
Entity
User
UserPopupItem.php
Создано системой
1.10.0