Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
textpropertytype.php
1
<?php
2
3
4
namespace
Bitrix\Calendar\ICal\Basic
;
5
6
7
class
TextPropertyType
extends
PropertyType
8
{
9
private
$text;
10
private
$disableEscaping;
11
12
public
static
function
getInstance
(
$names
,
string
$text, $disableEscaping =
false
):
TextPropertyType
13
{
14
return
new
self
(
$names
, $text, $disableEscaping);
15
}
16
17
public
function
__construct
(
$names
,
string
$text, $disableEscaping =
false
)
18
{
19
parent::__construct(
$names
);
20
21
$this->text = $text;
22
$this->disableEscaping = $disableEscaping;
23
}
24
25
public
function
getValue
(): string
26
{
27
if
($this->disableEscaping) {
28
return
$this->text;
29
}
30
31
$replacements = [
32
'\\'
=>
'\\\\'
,
33
'"'
=>
'\\"'
,
34
','
=>
'\\,'
,
35
';'
=>
'\\;'
,
36
"\n"
=>
'\\n'
,
37
];
38
39
return
str_replace(array_keys($replacements), $replacements, $this->text);
40
}
41
42
public
function
getOriginalValue
(): string
43
{
44
return
$this->text;
45
}
46
}
Bitrix\Calendar\ICal\Basic\PropertyType
Definition
propertytype.php:8
Bitrix\Calendar\ICal\Basic\PropertyType\$names
$names
Definition
propertytype.php:9
Bitrix\Calendar\ICal\Basic\TextPropertyType
Definition
textpropertytype.php:8
Bitrix\Calendar\ICal\Basic\TextPropertyType\__construct
__construct($names, string $text, $disableEscaping=false)
Definition
textpropertytype.php:17
Bitrix\Calendar\ICal\Basic\TextPropertyType\getInstance
static getInstance($names, string $text, $disableEscaping=false)
Definition
textpropertytype.php:12
Bitrix\Calendar\ICal\Basic\TextPropertyType\getOriginalValue
getOriginalValue()
Definition
textpropertytype.php:42
Bitrix\Calendar\ICal\Basic\TextPropertyType\getValue
getValue()
Definition
textpropertytype.php:25
Bitrix\Calendar\ICal\Basic
Definition
attachmentmanager.php:4
modules
calendar
lib
ical
basic
textpropertytype.php
Создано системой
1.10.0