Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
settingsbase.php
1
<?php
2
3
namespace
Bitrix\Sale\Exchange\OneC
;
4
5
6
use
Bitrix\Main\ArgumentNullException
;
7
use
Bitrix\Main\ArgumentTypeException
;
8
use
Bitrix\Main\NotImplementedException
;
9
use
Bitrix\Main\NotSupportedException
;
10
use
Bitrix\Sale\Exchange\EntityType
;
11
use
Bitrix\Sale\Exchange\ISettings
;
12
13
abstract
class
SettingsBase
14
implements
ISettings
15
{
16
protected
static
$currentSettings
=
null
;
17
protected
$settings
= array();
18
23
protected
function
__construct
(array
$settings
=
null
)
24
{
25
if
(
$settings
!==
null
)
26
{
27
$this->settings =
$settings
;
28
}
29
}
30
37
protected
function
resolveName
($entityTypeId)
38
{
39
if
(!is_int($entityTypeId))
40
{
41
throw
new
ArgumentTypeException
(
'entityTypeID'
,
'integer'
);
42
}
43
44
if
(!EntityType::IsDefined($entityTypeId))
45
{
46
throw
new
NotSupportedException
(
"Entity ID: '{$entityTypeId}' is not supported in current context"
);
47
}
48
49
return
EntityType::ResolveName($entityTypeId);
50
}
51
56
static
protected
function
loadCurrentSettings
()
57
{
58
throw
new
NotImplementedException
(
'The method is not implemented.'
);
59
}
60
67
protected
function
getValueFor
($entityTypeId, $name, $default=
''
)
68
{
69
$entityTypeName = $this->
resolveName
($entityTypeId);
70
return
(isset($this->settings[$name][$entityTypeName]) ? $this->settings[$name][$entityTypeName]: $default);
71
}
72
79
public
function
prefixFor
($entityTypeId)
80
{
81
return
$this->
getValueFor
($entityTypeId,
'accountNumberPrefix'
);
82
}
83
}
Bitrix\Main\ArgumentNullException
Definition
exception.php:54
Bitrix\Main\ArgumentTypeException
Definition
exception.php:114
Bitrix\Main\NotImplementedException
Definition
exception.php:147
Bitrix\Main\NotSupportedException
Definition
exception.php:159
Bitrix\Sale\Exchange\EntityType
Definition
entitytype.php:6
Bitrix\Sale\Exchange\OneC\SettingsBase
Definition
settingsbase.php:15
Bitrix\Sale\Exchange\OneC\SettingsBase\getValueFor
getValueFor($entityTypeId, $name, $default='')
Definition
settingsbase.php:67
Bitrix\Sale\Exchange\OneC\SettingsBase\__construct
__construct(array $settings=null)
Definition
settingsbase.php:23
Bitrix\Sale\Exchange\OneC\SettingsBase\prefixFor
prefixFor($entityTypeId)
Definition
settingsbase.php:79
Bitrix\Sale\Exchange\OneC\SettingsBase\$settings
$settings
Definition
settingsbase.php:17
Bitrix\Sale\Exchange\OneC\SettingsBase\loadCurrentSettings
static loadCurrentSettings()
Definition
settingsbase.php:56
Bitrix\Sale\Exchange\OneC\SettingsBase\$currentSettings
static $currentSettings
Definition
settingsbase.php:16
Bitrix\Sale\Exchange\OneC\SettingsBase\resolveName
resolveName($entityTypeId)
Definition
settingsbase.php:37
Bitrix\Sale\Exchange\ISettings
Definition
isettings.php:5
Bitrix\Sale\Exchange\OneC
Definition
documents.php:2
modules
sale
lib
exchange
onec
settingsbase.php
Создано системой
1.10.0