Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
checkrightsondecreasestoreamount.php
1
<?php
2
3
namespace
Bitrix\Catalog\Config\Options
;
4
5
use
Bitrix\Catalog\Config\State
;
6
14
class
CheckRightsOnDecreaseStoreAmount
extends
Option
15
{
16
public
const
NAME
=
'check_rights_on_decrease_store_quantity'
;
17
public
const
DEFAULT_VALUE
=
self::NOT_USED
;
18
19
public
const
ENABLED_VALUE
=
'E'
;
20
public
const
DISABLED_VALUE
=
'D'
;
21
public
const
NOT_USED
=
'N'
;
22
28
public
static
function
isNotUsed
(): bool
29
{
30
return
self::get
() ===
self::NOT_USED
;
31
}
32
38
public
static
function
isEnabled
(): bool
39
{
40
return
self::get
() === self::ENABLED_VALUE && !
State::isProductBatchMethodSelected
();
41
}
42
48
public
static
function
isDisabled
(): bool
49
{
50
return
self::get
() ===
self::DISABLED_VALUE
;
51
}
52
60
public
static
function
isAvailableValue
(
string
$value): bool
61
{
62
$available = [
63
self::ENABLED_VALUE
,
64
self::DISABLED_VALUE
,
65
self::NOT_USED
,
66
];
67
68
return
in_array($value, $available,
true
);
69
}
70
}
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount
Definition
checkrightsondecreasestoreamount.php:15
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\isAvailableValue
static isAvailableValue(string $value)
Definition
checkrightsondecreasestoreamount.php:60
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\NOT_USED
const NOT_USED
Definition
checkrightsondecreasestoreamount.php:21
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\DISABLED_VALUE
const DISABLED_VALUE
Definition
checkrightsondecreasestoreamount.php:20
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\NAME
const NAME
Definition
checkrightsondecreasestoreamount.php:16
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\DEFAULT_VALUE
const DEFAULT_VALUE
Definition
checkrightsondecreasestoreamount.php:17
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\isDisabled
static isDisabled()
Definition
checkrightsondecreasestoreamount.php:48
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\ENABLED_VALUE
const ENABLED_VALUE
Definition
checkrightsondecreasestoreamount.php:19
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\isEnabled
static isEnabled()
Definition
checkrightsondecreasestoreamount.php:38
Bitrix\Catalog\Config\Options\CheckRightsOnDecreaseStoreAmount\isNotUsed
static isNotUsed()
Definition
checkrightsondecreasestoreamount.php:28
Bitrix\Catalog\Config\Options\Option
Definition
option.php:14
Bitrix\Catalog\Config\Options\Option\get
static get()
Definition
option.php:23
Bitrix\Catalog\Config\State
Definition
state.php:21
Bitrix\Catalog\Config\State\isProductBatchMethodSelected
static isProductBatchMethodSelected()
Definition
state.php:909
Bitrix\Catalog\Config\Options
Definition
checkrightsondecreasestoreamount.php:3
modules
catalog
lib
config
options
checkrightsondecreasestoreamount.php
Создано системой
1.10.0