Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Invitation.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Space\List\Invitation
;
4
5
use
Bitrix\Main\Localization\Loc
;
6
use
Bitrix\Main\Type\Contract\Arrayable
;
7
use \Bitrix\Main\Type\DateTime;
8
9
final
class
Invitation
implements
Arrayable
10
{
11
private
?
Sender
$sender =
null
;
12
private
int
$receiverId = 0;
13
private
int
$spaceId = 0;
14
private
?Datetime $inviteDate =
null
;
15
16
public
function
setSender
(
Sender
$sender): self
17
{
18
$this->sender = $sender;
19
20
return
$this;
21
}
22
23
public
function
setReceiverId
(
int
$receiverId): self
24
{
25
$this->receiverId = $receiverId;
26
27
return
$this;
28
}
29
30
public
function
setInviteDate
(?
DateTime
$inviteDate): self
31
{
32
$this->inviteDate = $inviteDate;
33
34
return
$this;
35
}
36
37
public
function
setSpaceId
(
int
$spaceId): self
38
{
39
$this->spaceId = $spaceId;
40
41
return
$this;
42
}
43
44
public
function
getSpaceId
(): int
45
{
46
return
$this->spaceId;
47
}
48
49
private
function
getMessage(): string
50
{
51
return
Loc::getMessage
(
52
'SOCIALNETWORK_SPACES_LIST_INVITATION_MESSAGE'
,
53
[
'#NAME#'
=> $this->sender->getName()]
54
);
55
}
56
57
public
function
toArray
(): array
58
{
59
return
[
60
'sender'
=> $this->sender->toArray(),
61
'receiverId'
=> $this->receiverId,
62
'invitationDate'
=> $this->inviteDate,
63
'invitationDateTimestamp'
=> $this->inviteDate?->getTimestamp(),
64
'spaceId'
=> $this->spaceId,
65
'message'
=> $this->getMessage(),
66
];
67
}
68
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Socialnetwork\Space\List\Invitation\Invitation
Definition
Invitation.php:10
Bitrix\Socialnetwork\Space\List\Invitation\Invitation\setReceiverId
setReceiverId(int $receiverId)
Definition
Invitation.php:23
Bitrix\Socialnetwork\Space\List\Invitation\Invitation\setSpaceId
setSpaceId(int $spaceId)
Definition
Invitation.php:37
Bitrix\Socialnetwork\Space\List\Invitation\Invitation\setInviteDate
setInviteDate(?DateTime $inviteDate)
Definition
Invitation.php:30
Bitrix\Socialnetwork\Space\List\Invitation\Invitation\getSpaceId
getSpaceId()
Definition
Invitation.php:44
Bitrix\Socialnetwork\Space\List\Invitation\Invitation\toArray
toArray()
Definition
Invitation.php:57
Bitrix\Socialnetwork\Space\List\Invitation\Invitation\setSender
setSender(Sender $sender)
Definition
Invitation.php:16
Bitrix\Socialnetwork\Space\List\Invitation\Sender
Definition
Sender.php:8
Bitrix\Main\Type\Contract\Arrayable
Definition
arrayable.php:6
Bitrix\Socialnetwork\Space\List\Invitation
Definition
Invitation.php:3
modules
socialnetwork
lib
Space
List
Invitation
Invitation.php
Создано системой
1.10.0