Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
rule.php
1
<?php
2
10
namespace
Bitrix\Main\Authentication\Policy
;
11
12
abstract
class
Rule
implements
\JsonSerializable
13
{
14
protected
$title
;
15
protected
$value
;
16
protected
$options
= [
17
'type'
=>
'text'
,
18
'size'
=> 5,
19
];
20
protected
$groupId
= 0;
21
28
public
function
__construct
(
$title
,
$value
= 0, array
$options
=
null
)
29
{
30
$this->title =
$title
;
31
$this->value =
$value
;
32
if
(
$options
!==
null
)
33
{
34
$this->options =
$options
;
35
}
36
}
37
41
public
function
getTitle
()
42
{
43
return
$this->title
;
44
}
45
49
public
function
getValue
()
50
{
51
return
$this->value
;
52
}
53
59
public
function
assignValue
(
$value
): bool
60
{
61
if
($this->
compare
(
$value
))
62
{
63
$this->value =
$value
;
64
return
true
;
65
}
66
return
false
;
67
}
68
74
abstract
public
function
compare
(
$value
): bool;
75
79
public
function
getOptions
(): array
80
{
81
return
$this->options
;
82
}
83
87
public
function
getGroupId
(): int
88
{
89
return
$this->groupId
;
90
}
91
96
public
function
setGroupId
(
int
$groupId
):
Rule
97
{
98
$this->groupId =
$groupId
;
99
return
$this;
100
}
101
106
public
function
jsonSerialize
(): array
107
{
108
$class = get_class($this);
109
$class = substr($class, (
int
)strrpos($class,
'\\'
) + 1);
110
111
return
[
112
'value'
=>
$this->value
,
113
'type'
=> $class,
114
];
115
}
116
}
Bitrix\Main\Authentication\Policy\Rule
Definition
rule.php:13
Bitrix\Main\Authentication\Policy\Rule\$options
$options
Definition
rule.php:16
Bitrix\Main\Authentication\Policy\Rule\assignValue
assignValue($value)
Definition
rule.php:59
Bitrix\Main\Authentication\Policy\Rule\$value
$value
Definition
rule.php:15
Bitrix\Main\Authentication\Policy\Rule\getOptions
getOptions()
Definition
rule.php:79
Bitrix\Main\Authentication\Policy\Rule\__construct
__construct($title, $value=0, array $options=null)
Definition
rule.php:28
Bitrix\Main\Authentication\Policy\Rule\$groupId
$groupId
Definition
rule.php:20
Bitrix\Main\Authentication\Policy\Rule\getGroupId
getGroupId()
Definition
rule.php:87
Bitrix\Main\Authentication\Policy\Rule\compare
compare($value)
Bitrix\Main\Authentication\Policy\Rule\getTitle
getTitle()
Definition
rule.php:41
Bitrix\Main\Authentication\Policy\Rule\setGroupId
setGroupId(int $groupId)
Definition
rule.php:96
Bitrix\Main\Authentication\Policy\Rule\getValue
getValue()
Definition
rule.php:49
Bitrix\Main\Authentication\Policy\Rule\jsonSerialize
jsonSerialize()
Definition
rule.php:106
Bitrix\Main\Authentication\Policy\Rule\$title
$title
Definition
rule.php:14
Bitrix\Main\Authentication\Policy
Definition
booleanrule.php:10
modules
main
lib
authentication
policy
rule.php
Создано системой
1.10.0