Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
configitem.php
1
<?php
2
3
namespace
Bitrix\Location\Entity\Source
;
4
5
use
Bitrix\Location\Exception\RuntimeException
;
6
12
final
class
ConfigItem
13
{
14
public
const
STRING_TYPE
=
'string'
;
15
public
const
BOOL_TYPE
=
'bool'
;
16
18
private
$code;
19
21
private
$type;
22
24
private
$isVisible =
true
;
25
27
private
$sort = 1000;
28
30
private
$value;
31
37
public
function
__construct
(
string
$code,
string
$type)
38
{
39
$this->code = $code;
40
41
if
(!in_array($type, [static::STRING_TYPE, static::BOOL_TYPE]))
42
{
43
throw
new
RuntimeException
(sprintf(
'Unexpected config item type - %s'
, $type));
44
}
45
$this->type = $type;
46
}
47
51
public
function
getCode
(): string
52
{
53
return
$this->code;
54
}
55
59
public
function
getType
(): string
60
{
61
return
$this->type;
62
}
63
67
public
function
getSort
(): int
68
{
69
return
$this->sort;
70
}
71
76
public
function
setSort
(
int
$sort):
ConfigItem
77
{
78
$this->sort = $sort;
79
80
return
$this;
81
}
82
86
public
function
isVisible
(): bool
87
{
88
return
$this->isVisible;
89
}
90
95
public
function
setIsVisible
(
bool
$isVisible):
ConfigItem
96
{
97
$this->
isVisible
= $isVisible;
98
99
return
$this;
100
}
101
105
public
function
getValue
()
106
{
107
return
$this->value;
108
}
109
114
public
function
setValue
($value):
ConfigItem
115
{
116
$this->value = $value;
117
118
return
$this;
119
}
120
}
Bitrix\Location\Entity\Source\ConfigItem
Definition
configitem.php:13
Bitrix\Location\Entity\Source\ConfigItem\BOOL_TYPE
const BOOL_TYPE
Definition
configitem.php:15
Bitrix\Location\Entity\Source\ConfigItem\isVisible
isVisible()
Definition
configitem.php:86
Bitrix\Location\Entity\Source\ConfigItem\setValue
setValue($value)
Definition
configitem.php:114
Bitrix\Location\Entity\Source\ConfigItem\getType
getType()
Definition
configitem.php:59
Bitrix\Location\Entity\Source\ConfigItem\setSort
setSort(int $sort)
Definition
configitem.php:76
Bitrix\Location\Entity\Source\ConfigItem\STRING_TYPE
const STRING_TYPE
Definition
configitem.php:14
Bitrix\Location\Entity\Source\ConfigItem\getSort
getSort()
Definition
configitem.php:67
Bitrix\Location\Entity\Source\ConfigItem\getCode
getCode()
Definition
configitem.php:51
Bitrix\Location\Entity\Source\ConfigItem\getValue
getValue()
Definition
configitem.php:105
Bitrix\Location\Entity\Source\ConfigItem\__construct
__construct(string $code, string $type)
Definition
configitem.php:37
Bitrix\Location\Entity\Source\ConfigItem\setIsVisible
setIsVisible(bool $isVisible)
Definition
configitem.php:95
Bitrix\Location\Exception\RuntimeException
Definition
runtimeexception.php:6
Bitrix\Location\Entity\Source
Definition
config.php:3
modules
location
lib
entity
source
configitem.php
Создано системой
1.10.0