Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
reservationsettingsservice.php
1
<?php
2
3
namespace
Bitrix\Sale\Reservation\Configuration
;
4
5
use
Bitrix\Main\Config\Option
;
6
use
Bitrix\Main\DI\ServiceLocator
;
7
11
class
ReservationSettingsService
12
{
13
private
const
OPTION_RESERVE_CONDITION =
'product_reserve_condition'
;
14
private
const
OPTION_CLEAR_PERIOD =
'product_reserve_clear_period'
;
15
21
public
static
function
getInstance
(): self
22
{
23
return
ServiceLocator::getInstance()->get(
'sale.reservation.settings'
);
24
}
25
34
public
function
get
():
ReservationSettings
35
{
36
$settings =
new
ReservationSettings
(
37
(
int
)Option::get(
'sale'
, self::OPTION_CLEAR_PERIOD),
38
(
string
)Option::get(
'sale'
, self::OPTION_RESERVE_CONDITION) ?: null
39
);
40
41
$event =
new
ReservationSettingsBuildEvent
($settings);
42
$event->send();
43
44
return
$settings;
45
}
46
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\DI\ServiceLocator
Definition
servicelocator.php:12
Bitrix\Sale\Reservation\Configuration\ReservationSettingsBuildEvent
Definition
reservationsettingsbuildevent.php:27
Bitrix\Sale\Reservation\Configuration\ReservationSettings
Definition
reservationsettings.php:10
Bitrix\Sale\Reservation\Configuration\ReservationSettingsService
Definition
reservationsettingsservice.php:12
Bitrix\Sale\Reservation\Configuration\ReservationSettingsService\getInstance
static getInstance()
Definition
reservationsettingsservice.php:21
Bitrix\Sale\Reservation\Configuration
Definition
reservationsettings.php:3
modules
sale
lib
reservation
configuration
reservationsettingsservice.php
Создано системой
1.10.0