Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
serializedfield.php
1
<?php
2
namespace
Bitrix\Sale\Archive\Recovery
;
3
4
use
Bitrix\Main
,
5
Bitrix\Sale
,
6
Bitrix\Sale\Archive
,
7
Bitrix\Sale\Internals
;
8
12
class
SerializedField
extends
PackedField
13
{
14
public
function
tryUnpack
()
15
{
16
$result =
new
Main\Result
();
17
if
(!unserialize($this->packedValue, [
'allowed_classes'
=>
false
]))
18
{
19
$result->addError(
new
Main\
Error
(
'Unavailable value for unpacking'
));
20
}
21
return
$result;
22
}
23
24
public
function
unpack
()
25
{
26
$value = unserialize($this->packedValue, [
'allowed_classes'
=> [
27
\
Bitrix
\Main\
Type
\DateTime::class,
28
\
Bitrix
\Main\
Type
\Date::class,
29
\DateTime::class,
30
\DateTimeZone::class,
31
]]);
32
33
if
(!$value)
34
{
35
return
null
;
36
}
37
38
return
$value;
39
}
40
}
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Sale\Archive\Recovery\PackedField
Definition
packedfield.php:10
Bitrix\Sale\Archive\Recovery\SerializedField
Definition
serializedfield.php:13
Bitrix\Sale\Archive\Recovery\SerializedField\unpack
unpack()
Definition
serializedfield.php:24
Bitrix\Sale\Archive\Recovery\SerializedField\tryUnpack
tryUnpack()
Definition
serializedfield.php:14
Bitrix\Main\Type
Definition
collection.php:2
Bitrix\Main
Bitrix\Sale\Archive\Recovery
Definition
archivepackable.php:2
Bitrix\Sale\Archive
Definition
manager.php:2
Bitrix\Sale\Internals
Definition
accountnumber.php:3
Bitrix\Sale
Bitrix
modules
sale
lib
archive
recovery
serializedfield.php
Создано системой
1.10.0