1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
textnode.php
См. документацию.
1
<?
2
namespace
Bitrix\UI\EntitySelector;
3
4
class
TextNode
implements
\JsonSerializable
5
{
6
protected
?
string
$text
=
null
;
7
protected
?
string
$type
=
null
;
8
9
public
function
__construct
(
$options
)
10
{
11
if
(is_array(
$options
))
12
{
13
if
(isset(
$options
[
'text'
]) && (is_string(
$options
[
'text'
]) || is_int(
$options
[
'text'
])))
14
{
15
$this->text = (string)
$options
[
'text'
];
16
}
17
18
if
(isset(
$options
[
'type'
]) &&
TextNodeType::isValid
(
$options
[
'type'
]))
19
{
20
$this->type =
$options
[
'type'
];
21
}
22
}
23
else
if
(is_string(
$options
) || is_int(
$options
))
24
{
25
$this->text = (string)
$options
;
26
}
27
}
28
29
public
static
function
isValidText
(
$text
): bool
30
{
31
return
is_string(
$text
) || is_int(
$text
) || is_array(
$text
);
32
}
33
34
public
function
getType
(): ?string
35
{
36
return
$this->type
;
37
}
38
39
public
function
getText
(): ?string
40
{
41
return
$this->text
;
42
}
43
44
public
function
isNullable
(): bool
45
{
46
return
$this->
getText
() ===
null
;
47
}
48
49
public
function
jsonSerialize
()
50
{
51
if
($this->
getType
() ===
null
)
52
{
53
return
$this->
getText
();
54
}
55
else
56
{
57
return
[
58
'text'
=> $this->
getText
(),
59
'type'
=> $this->
getType
()
60
];
61
}
62
}
63
}
Bitrix\UI\EntitySelector\TextNode
Определения
textnode.php:5
Bitrix\UI\EntitySelector\TextNode\getType
getType()
Определения
textnode.php:34
Bitrix\UI\EntitySelector\TextNode\getText
getText()
Определения
textnode.php:39
Bitrix\UI\EntitySelector\TextNode\isValidText
static isValidText($text)
Определения
textnode.php:29
Bitrix\UI\EntitySelector\TextNode\$type
string $type
Определения
textnode.php:7
Bitrix\UI\EntitySelector\TextNode\$text
string $text
Определения
textnode.php:6
Bitrix\UI\EntitySelector\TextNode\jsonSerialize
jsonSerialize()
Определения
textnode.php:49
Bitrix\UI\EntitySelector\TextNode\__construct
__construct($options)
Определения
textnode.php:9
Bitrix\UI\EntitySelector\TextNode\isNullable
isNullable()
Определения
textnode.php:44
Bitrix\UI\EntitySelector\TextNodeType\isValid
static isValid($type)
Определения
textnodetype.php:9
$options
$options
Определения
commerceml2.php:49
bitrix
modules
ui
lib
entityselector
textnode.php
Создано системой
1.14.0