1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
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
}
$type
$type
Определения
options.php:106
Bitrix\Location\Entity\Source\ConfigItem
Определения
configitem.php:13
Bitrix\Location\Entity\Source\ConfigItem\BOOL_TYPE
const BOOL_TYPE
Определения
configitem.php:15
Bitrix\Location\Entity\Source\ConfigItem\isVisible
isVisible()
Определения
configitem.php:86
Bitrix\Location\Entity\Source\ConfigItem\setValue
setValue($value)
Определения
configitem.php:114
Bitrix\Location\Entity\Source\ConfigItem\getType
getType()
Определения
configitem.php:59
Bitrix\Location\Entity\Source\ConfigItem\setSort
setSort(int $sort)
Определения
configitem.php:76
Bitrix\Location\Entity\Source\ConfigItem\STRING_TYPE
const STRING_TYPE
Определения
configitem.php:14
Bitrix\Location\Entity\Source\ConfigItem\getSort
getSort()
Определения
configitem.php:67
Bitrix\Location\Entity\Source\ConfigItem\getCode
getCode()
Определения
configitem.php:51
Bitrix\Location\Entity\Source\ConfigItem\getValue
getValue()
Определения
configitem.php:105
Bitrix\Location\Entity\Source\ConfigItem\__construct
__construct(string $code, string $type)
Определения
configitem.php:37
Bitrix\Location\Entity\Source\ConfigItem\setIsVisible
setIsVisible(bool $isVisible)
Определения
configitem.php:95
Bitrix\Location\Exception\RuntimeException
Определения
runtimeexception.php:6
$code
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения
options.php:195
bitrix
modules
location
lib
entity
source
configitem.php
Создано системой
1.14.0