Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
reservationsettingsservice.php
1<?php
2
4
7
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}