Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
reservecondition.php
1
<?php
2
3
namespace
Bitrix\Sale\Reservation\Configuration
;
4
5
use
Bitrix\Main\SystemException
;
6
12
class
ReserveCondition
13
{
14
public
const
ON_CREATE
=
'O'
;
15
public
const
ON_PAY
=
'R'
;
16
public
const
ON_FULL_PAY
=
'P'
;
17
public
const
ON_ALLOW_DELIVERY
=
'D'
;
18
public
const
ON_SHIP
=
'S'
;
19
30
public
static
function
validate
(
string
$value): void
31
{
32
if
(!self::isValid($value))
33
{
34
throw
new
SystemException
(
"Invalid reserve condition value: '{$value}'"
);
35
}
36
}
37
43
public
static
function
getAvailableValues
(): array
44
{
45
return
[
46
self::ON_CREATE
,
47
self::ON_PAY
,
48
self::ON_FULL_PAY
,
49
self::ON_ALLOW_DELIVERY
,
50
self::ON_SHIP
,
51
];
52
}
53
61
public
static
function
isValid
(
string
$value): bool
62
{
63
return
in_array($value, self::getAvailableValues(),
true
);
64
}
65
}
Bitrix\Main\SystemException
Definition
exception.php:8
Bitrix\Sale\Reservation\Configuration\ReserveCondition
Definition
reservecondition.php:13
Bitrix\Sale\Reservation\Configuration\ReserveCondition\ON_SHIP
const ON_SHIP
Definition
reservecondition.php:18
Bitrix\Sale\Reservation\Configuration\ReserveCondition\ON_CREATE
const ON_CREATE
Definition
reservecondition.php:14
Bitrix\Sale\Reservation\Configuration\ReserveCondition\ON_ALLOW_DELIVERY
const ON_ALLOW_DELIVERY
Definition
reservecondition.php:17
Bitrix\Sale\Reservation\Configuration\ReserveCondition\getAvailableValues
static getAvailableValues()
Definition
reservecondition.php:43
Bitrix\Sale\Reservation\Configuration\ReserveCondition\ON_PAY
const ON_PAY
Definition
reservecondition.php:15
Bitrix\Sale\Reservation\Configuration\ReserveCondition\isValid
static isValid(string $value)
Definition
reservecondition.php:61
Bitrix\Sale\Reservation\Configuration\ReserveCondition\validate
static validate(string $value)
Definition
reservecondition.php:30
Bitrix\Sale\Reservation\Configuration\ReserveCondition\ON_FULL_PAY
const ON_FULL_PAY
Definition
reservecondition.php:16
Bitrix\Sale\Reservation\Configuration
Definition
reservationsettings.php:3
modules
sale
lib
reservation
configuration
reservecondition.php
Создано системой
1.10.0