Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
link.php
1
<?php
2
namespace
Bitrix\Calendar\Sharing\Link
;
3
4
use
Bitrix\Calendar\Core\Base\EntityInterface
;
5
use
Bitrix\Main\Type\DateTime
;
6
7
abstract
class
Link
implements
EntityInterface
8
{
9
public
const
SHARING_PUBLIC_PATH
=
'pub/calendar-sharing'
;
10
11
protected
int
$id
;
12
protected
int
$objectId
;
13
protected
string
$hash
;
14
protected
bool
$active
;
15
protected
?
DateTime
$dateCreate
=
null
;
16
protected
?
DateTime
$dateExpire
=
null
;
17
protected
?
int
$frequentUse
=
null
;
18
22
public
function
getId
(): ?int
23
{
24
return
$this->
id
??
null
;
25
}
26
31
public
function
setId
(
int
$id): self
32
{
33
$this->
id
= $id;
34
35
return
$this;
36
}
37
41
public
function
getObjectId
(): int
42
{
43
return
$this->objectId;
44
}
45
50
public
function
setObjectId
(
int
$objectId): self
51
{
52
$this->objectId = $objectId;
53
54
return
$this;
55
}
56
60
public
function
isActive
(): bool
61
{
62
return
$this->active;
63
}
64
69
public
function
setActive
(
bool
$active): self
70
{
71
$this->active = $active;
72
73
return
$this;
74
}
75
79
public
function
getDateCreate
(): ?
DateTime
80
{
81
return
$this->dateCreate;
82
}
83
88
public
function
setDateCreate
(
DateTime
$dateCreate): self
89
{
90
$this->dateCreate = $dateCreate;
91
92
return
$this;
93
}
94
98
public
function
getDateExpire
(): ?
DateTime
99
{
100
return
$this->dateExpire;
101
}
102
107
public
function
setDateExpire
(?
DateTime
$dateExpire): self
108
{
109
$this->dateExpire = $dateExpire;
110
111
return
$this;
112
}
113
117
public
function
getFrequentUse
(): ?int
118
{
119
return
$this->frequentUse;
120
}
121
126
public
function
setFrequentUse
(?
int
$frequentUse): self
127
{
128
$this->frequentUse = $frequentUse;
129
130
return
$this;
131
}
132
133
public
function
getHash
(): string
134
{
135
if
(empty($this->hash))
136
{
137
$this->hash = $this->
generateHash
();
138
}
139
140
return
$this->hash;
141
}
142
143
public
function
setHash
(
string
$hash): self
144
{
145
$this->hash = $hash;
146
147
return
$this;
148
}
149
150
public
function
getUrl
(): string
151
{
152
$serverPath = \CCalendar::GetServerPath();
153
$publicPath = self::SHARING_PUBLIC_PATH;
154
$hash = $this->
getHash
();
155
156
return
"$serverPath/$publicPath/$hash/"
;
157
}
158
159
public
function
generateHash
(): string
160
{
161
return
hash(
'sha256'
, $this->objectId . $this->
getObjectType
() . microtime() . \CMain::getServerUniqID());
162
}
163
164
public
function
isJoint
(): bool
165
{
166
return
false
;
167
}
168
169
abstract
public
function
getObjectType
(): string;
170
}
Bitrix\Calendar\Sharing\Link\Link
Definition
link.php:8
Bitrix\Calendar\Sharing\Link\Link\getFrequentUse
getFrequentUse()
Definition
link.php:117
Bitrix\Calendar\Sharing\Link\Link\getHash
getHash()
Definition
link.php:133
Bitrix\Calendar\Sharing\Link\Link\getId
getId()
Definition
link.php:22
Bitrix\Calendar\Sharing\Link\Link\setObjectId
setObjectId(int $objectId)
Definition
link.php:50
Bitrix\Calendar\Sharing\Link\Link\$frequentUse
int $frequentUse
Definition
link.php:17
Bitrix\Calendar\Sharing\Link\Link\$hash
string $hash
Definition
link.php:13
Bitrix\Calendar\Sharing\Link\Link\getObjectId
getObjectId()
Definition
link.php:41
Bitrix\Calendar\Sharing\Link\Link\getDateCreate
getDateCreate()
Definition
link.php:79
Bitrix\Calendar\Sharing\Link\Link\setHash
setHash(string $hash)
Definition
link.php:143
Bitrix\Calendar\Sharing\Link\Link\$id
int $id
Definition
link.php:11
Bitrix\Calendar\Sharing\Link\Link\getDateExpire
getDateExpire()
Definition
link.php:98
Bitrix\Calendar\Sharing\Link\Link\$active
bool $active
Definition
link.php:14
Bitrix\Calendar\Sharing\Link\Link\isJoint
isJoint()
Definition
link.php:164
Bitrix\Calendar\Sharing\Link\Link\setActive
setActive(bool $active)
Definition
link.php:69
Bitrix\Calendar\Sharing\Link\Link\$dateExpire
DateTime $dateExpire
Definition
link.php:16
Bitrix\Calendar\Sharing\Link\Link\isActive
isActive()
Definition
link.php:60
Bitrix\Calendar\Sharing\Link\Link\setDateExpire
setDateExpire(?DateTime $dateExpire)
Definition
link.php:107
Bitrix\Calendar\Sharing\Link\Link\$dateCreate
DateTime $dateCreate
Definition
link.php:15
Bitrix\Calendar\Sharing\Link\Link\SHARING_PUBLIC_PATH
const SHARING_PUBLIC_PATH
Definition
link.php:9
Bitrix\Calendar\Sharing\Link\Link\generateHash
generateHash()
Definition
link.php:159
Bitrix\Calendar\Sharing\Link\Link\getUrl
getUrl()
Definition
link.php:150
Bitrix\Calendar\Sharing\Link\Link\setDateCreate
setDateCreate(DateTime $dateCreate)
Definition
link.php:88
Bitrix\Calendar\Sharing\Link\Link\$objectId
int $objectId
Definition
link.php:12
Bitrix\Calendar\Sharing\Link\Link\getObjectType
getObjectType()
Bitrix\Calendar\Sharing\Link\Link\setFrequentUse
setFrequentUse(?int $frequentUse)
Definition
link.php:126
Bitrix\Calendar\Sharing\Link\Link\setId
setId(int $id)
Definition
link.php:31
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Calendar\Core\Base\EntityInterface
Definition
entityinterface.php:6
Bitrix\Calendar\Sharing\Link
Definition
crmdeallink.php:3
modules
calendar
lib
sharing
link
link.php
Создано системой
1.10.0