Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ViewItem.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Entity\View
;
4
5
use Bitrix\Im\V2\Common\ContextCustomer;
6
use
Bitrix\Im\V2\Entity\User\UserPopupItem
;
7
use
Bitrix\Im\V2\Rest\PopupData
;
8
use
Bitrix\Im\V2\Rest\PopupDataAggregatable
;
9
use
Bitrix\Im\V2\Rest\RestEntity
;
10
use
Bitrix\Main\Type\DateTime
;
11
12
class
ViewItem
implements
RestEntity
,
PopupDataAggregatable
13
{
14
use ContextCustomer;
15
16
protected
int
$id
;
17
protected
int
$messageId
;
18
protected
DateTime
$dateView
;
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
}
Bitrix\Im\V2\Entity\User\UserPopupItem
Definition
UserPopupItem.php:8
Bitrix\Im\V2\Entity\View\ViewItem
Definition
ViewItem.php:13
Bitrix\Im\V2\Entity\View\ViewItem\getUserId
getUserId()
Definition
ViewItem.php:49
Bitrix\Im\V2\Entity\View\ViewItem\getRestEntityName
static getRestEntityName()
Definition
ViewItem.php:54
Bitrix\Im\V2\Entity\View\ViewItem\getId
getId()
Definition
ViewItem.php:34
Bitrix\Im\V2\Entity\View\ViewItem\toRestFormat
toRestFormat(array $option=[])
Definition
ViewItem.php:59
Bitrix\Im\V2\Entity\View\ViewItem\$dateView
DateTime $dateView
Definition
ViewItem.php:18
Bitrix\Im\V2\Entity\View\ViewItem\$id
int $id
Definition
ViewItem.php:16
Bitrix\Im\V2\Entity\View\ViewItem\getPopupData
getPopupData(array $excludedList=[])
Definition
ViewItem.php:29
Bitrix\Im\V2\Entity\View\ViewItem\getMessageId
getMessageId()
Definition
ViewItem.php:39
Bitrix\Im\V2\Entity\View\ViewItem\__construct
__construct(int $id, int $messageId, int $userId, DateTime $dateView)
Definition
ViewItem.php:21
Bitrix\Im\V2\Entity\View\ViewItem\$userId
int $userId
Definition
ViewItem.php:19
Bitrix\Im\V2\Entity\View\ViewItem\getDateView
getDateView()
Definition
ViewItem.php:44
Bitrix\Im\V2\Entity\View\ViewItem\$messageId
int $messageId
Definition
ViewItem.php:17
Bitrix\Im\V2\Rest\PopupData
Definition
PopupData.php:6
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Im\V2\Rest\PopupDataAggregatable
Definition
PopupDataAggregatable.php:10
Bitrix\Im\V2\Rest\RestEntity
Definition
RestEntity.php:8
Bitrix\Im\V2\Entity\View
Definition
ViewCollection.php:3
modules
im
lib
V2
Entity
View
ViewItem.php
Создано системой
1.10.0