Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ViewItem.php
1<?php
2
4
5use Bitrix\Im\V2\Common\ContextCustomer;
11
13{
14 use ContextCustomer;
15
16 protected int $id;
17 protected int $messageId;
19 protected int $userId;
20
21 public function __construct(int $id, int $messageId, int $userId, DateTime $dateView)
22 {
23 $this->id = $id;
24 $this->messageId = $messageId;
25 $this->userId = $userId;
26 $this->dateView = $dateView;
27 }
28
29 public function getPopupData(array $excludedList = []): PopupData
30 {
31 return (new PopupData([new UserPopupItem([$this->userId])], $excludedList));
32 }
33
34 public function getId(): int
35 {
36 return $this->id;
37 }
38
39 public function getMessageId(): int
40 {
41 return $this->messageId;
42 }
43
44 public function getDateView(): DateTime
45 {
46 return $this->dateView;
47 }
48
49 public function getUserId(): int
50 {
51 return $this->userId;
52 }
53
54 public static function getRestEntityName(): string
55 {
56 return 'view';
57 }
58
59 public function toRestFormat(array $option = []): array
60 {
61 return [
62 'id' => $this->getId(),
63 'messageId' => $this->getMessageId(),
64 'userId' => $this->getUserId(),
65 'dateView' => $this->getDateView(),
66 ];
67 }
68}
toRestFormat(array $option=[])
Definition ViewItem.php:59
getPopupData(array $excludedList=[])
Definition ViewItem.php:29
__construct(int $id, int $messageId, int $userId, DateTime $dateView)
Definition ViewItem.php:21