Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
UserPopupItem.php
1<?php
2
4
6
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 {
32 }
33
34 public function toRestFormat(array $option = []): array
35 {
36 return (new UserCollection(array_unique($this->userIds)))->getUnique()->toRestFormat($option);
37 }
38}