Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ComponentParams.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Message\Param
;
4
5
use
Bitrix\Im\Text
;
6
use
Bitrix\Im\V2\Message\Param
;
7
use
Bitrix\Main\ArgumentException
;
8
use
Bitrix\Main\Engine\Response\Converter
;
9
use
Bitrix\Main\Web\Json
;
10
11
class
ComponentParams
extends
Param
12
{
13
protected
?
string
$type
=
Param::TYPE_JSON
;
14
15
public
function
setValue
(
$value
): self
16
{
17
$this->value =
$value
;
18
$this->jsonValue = Json::encode(
$value
);
19
20
return
$this;
21
}
22
public
function
saveValueFilter
(
$value
)
23
{
24
return
''
;
25
}
26
27
public
function
loadValueFilter
(
$value
)
28
{
29
if
(!empty(
$value
))
30
{
31
$value
=
Text::decodeEmoji
(
$value
);
32
}
33
else
34
{
35
$value
=
null
;
36
}
37
38
return
$value
;
39
}
40
41
public
function
saveJsonFilter
(
$value
)
42
{
43
return
$this->jsonValue
;
44
}
45
46
public
function
loadJsonFilter
(
$value
)
47
{
48
if
(!empty(
$value
))
49
{
50
try
51
{
52
$this->value = \Bitrix\Main\Web\Json::decode(
$value
);
53
}
54
catch
(
ArgumentException
$ext)
55
{}
56
}
57
else
58
{
59
$value
=
null
;
60
}
61
62
return
$value
;
63
}
64
65
public
function
toRestFormat
(): ?array
66
{
67
return
Converter::toJson()->process($this->
getValue
());
68
}
69
70
public
function
toPullFormat
(): ?array
71
{
72
return
Converter::toJson()->process($this->
getValue
());
73
}
74
}
Bitrix\Im\Text
Definition
text.php:9
Bitrix\Im\Text\decodeEmoji
static decodeEmoji($text)
Definition
text.php:359
Bitrix\Im\V2\Message\Param\ComponentParams
Definition
ComponentParams.php:12
Bitrix\Im\V2\Message\Param\ComponentParams\toPullFormat
toPullFormat()
Definition
ComponentParams.php:70
Bitrix\Im\V2\Message\Param\ComponentParams\setValue
setValue($value)
Definition
ComponentParams.php:15
Bitrix\Im\V2\Message\Param\ComponentParams\saveJsonFilter
saveJsonFilter($value)
Definition
ComponentParams.php:41
Bitrix\Im\V2\Message\Param\ComponentParams\loadJsonFilter
loadJsonFilter($value)
Definition
ComponentParams.php:46
Bitrix\Im\V2\Message\Param\ComponentParams\loadValueFilter
loadValueFilter($value)
Definition
ComponentParams.php:27
Bitrix\Im\V2\Message\Param\ComponentParams\$type
string $type
Definition
ComponentParams.php:13
Bitrix\Im\V2\Message\Param\ComponentParams\saveValueFilter
saveValueFilter($value)
Definition
ComponentParams.php:22
Bitrix\Im\V2\Message\Param\ComponentParams\toRestFormat
toRestFormat()
Definition
ComponentParams.php:65
Bitrix\Im\V2\Message\Param
Definition
Param.php:19
Bitrix\Im\V2\Message\Param\$value
$value
Definition
Param.php:45
Bitrix\Im\V2\Message\Param\$jsonValue
string $jsonValue
Definition
Param.php:48
Bitrix\Im\V2\Message\Param\TYPE_JSON
const TYPE_JSON
Definition
Param.php:33
Bitrix\Im\V2\Message\Param\getValue
getValue()
Definition
Param.php:184
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\Engine\Response\Converter
Definition
converter.php:8
Bitrix\Main\Web\Json
Definition
json.php:11
Bitrix\Im\V2\Message\Param
Definition
Attach.php:3
modules
im
lib
V2
Message
Param
ComponentParams.php
Создано системой
1.10.0