Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
UserPerPhone.php
1
<?php
2
3
namespace
Bitrix\MessageService\Restriction
;
4
5
use
Bitrix\Main\Engine\CurrentUser
;
6
7
class
UserPerPhone
extends
Base
8
{
9
use
Parameterizable
;
10
11
public
function
getEntityId
(): string
12
{
13
return
'upp_'
. $this->
getEntity
();
14
}
15
16
public
function
isCanSend
(): bool
17
{
18
if
($this->
getCurrentAdditionalParam
() ===
'0'
)
19
{
20
return
true
;
21
}
22
23
return
parent::isCanSend();
24
}
25
26
public
function
increase
(): bool
27
{
28
if
($this->
getCurrentAdditionalParam
() ===
'0'
)
29
{
30
return
true
;
31
}
32
33
return
parent::increase();
34
}
35
36
37
protected
function
getOptionLimitName
(): string
38
{
39
return
'network_restriction_user_per_phone'
;
40
}
41
42
protected
function
getEntity
(): string
43
{
44
return
$this->message->getTo();
45
}
46
47
protected
function
getCurrentAdditionalParam
(): string
48
{
49
return
(
string
)($this->message->getAuthorId() ?: CurrentUser::get()->getId());
50
}
51
52
protected
function
getDefaultLimit
(): int
53
{
54
return
0;
55
}
56
}
Bitrix\Main\Engine\CurrentUser
Definition
currentuser.php:8
Bitrix\MessageService\Restriction\Base
Definition
Base.php:12
Bitrix\MessageService\Restriction\UserPerPhone
Definition
UserPerPhone.php:8
Bitrix\MessageService\Restriction\UserPerPhone\getEntityId
getEntityId()
Definition
UserPerPhone.php:11
Bitrix\MessageService\Restriction\UserPerPhone\getEntity
getEntity()
Definition
UserPerPhone.php:42
Bitrix\MessageService\Restriction\UserPerPhone\getDefaultLimit
getDefaultLimit()
Definition
UserPerPhone.php:52
Bitrix\MessageService\Restriction\UserPerPhone\increase
increase()
Definition
UserPerPhone.php:26
Bitrix\MessageService\Restriction\UserPerPhone\getOptionLimitName
getOptionLimitName()
Definition
UserPerPhone.php:37
Bitrix\MessageService\Restriction\UserPerPhone\isCanSend
isCanSend()
Definition
UserPerPhone.php:16
Bitrix\MessageService\Restriction\UserPerPhone\getCurrentAdditionalParam
getCurrentAdditionalParam()
Definition
UserPerPhone.php:47
Bitrix\MessageService\Restriction
Definition
Base.php:3
Bitrix\MessageService\Restriction\Parameterizable
trait Parameterizable
Definition
Parameterizable.php:8
modules
messageservice
lib
Restriction
UserPerPhone.php
Создано системой
1.10.0