Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
status.php
1
<?php
2
3
namespace
Bitrix\Sale\Delivery\Requests\Message
;
4
5
use
Bitrix\Main\SystemException
;
6
12
final
class
Status
13
{
14
private
const
SEMANTIC_SUCCESS =
'success'
;
15
private
const
SEMANTIC_ERROR =
'error'
;
16
private
const
SEMANTIC_PROCESS =
'process'
;
17
19
private
$message;
20
22
private
$semantic;
23
30
public
function
__construct
(
string
$message,
string
$semantic)
31
{
32
$this->message = $message;
33
if
(!in_array($semantic, [self::SEMANTIC_SUCCESS, self::SEMANTIC_PROCESS, self::SEMANTIC_ERROR]))
34
{
35
throw
new
SystemException
(sprintf(
'Unexpected semantic: %s'
, $semantic));
36
}
37
38
$this->semantic = $semantic;
39
}
40
44
public
function
getMessage
(): string
45
{
46
return
$this->message;
47
}
48
52
public
function
getSemantic
(): string
53
{
54
return
$this->semantic;
55
}
56
60
public
static
function
getSuccessSemantic
(): string
61
{
62
return
self::SEMANTIC_SUCCESS;
63
}
64
68
public
static
function
getErrorSemantic
(): string
69
{
70
return
self::SEMANTIC_ERROR;
71
}
72
76
public
static
function
getProcessSemantic
(): string
77
{
78
return
self::SEMANTIC_PROCESS;
79
}
80
84
public
static
function
getAvailableSemantics
(): array
85
{
86
return
[
87
self::getSuccessSemantic
(),
88
self::getErrorSemantic
(),
89
self::getProcessSemantic
(),
90
];
91
}
92
}
Bitrix\Main\SystemException
Definition
exception.php:8
Bitrix\Sale\Delivery\Requests\Message\Status
Definition
status.php:13
Bitrix\Sale\Delivery\Requests\Message\Status\getMessage
getMessage()
Definition
status.php:44
Bitrix\Sale\Delivery\Requests\Message\Status\getAvailableSemantics
static getAvailableSemantics()
Definition
status.php:84
Bitrix\Sale\Delivery\Requests\Message\Status\getSemantic
getSemantic()
Definition
status.php:52
Bitrix\Sale\Delivery\Requests\Message\Status\getSuccessSemantic
static getSuccessSemantic()
Definition
status.php:60
Bitrix\Sale\Delivery\Requests\Message\Status\getErrorSemantic
static getErrorSemantic()
Definition
status.php:68
Bitrix\Sale\Delivery\Requests\Message\Status\getProcessSemantic
static getProcessSemantic()
Definition
status.php:76
Bitrix\Sale\Delivery\Requests\Message\Status\__construct
__construct(string $message, string $semantic)
Definition
status.php:30
Bitrix\Sale\Delivery\Requests\Message
Definition
message.php:3
modules
sale
lib
delivery
requests
message
status.php
Создано системой
1.10.0