1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
settingsbase.php
См. документацию.
1<?php
2
3namespace Bitrix\Sale\Exchange\OneC;
4
5
6use Bitrix\Main\ArgumentNullException;
7use Bitrix\Main\ArgumentTypeException;
8use Bitrix\Main\NotImplementedException;
9use Bitrix\Main\NotSupportedException;
10use Bitrix\Sale\Exchange\EntityType;
11use Bitrix\Sale\Exchange\ISettings;
12
13abstract 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}
getValueFor($entityTypeId, $name, $default='')
Определения settingsbase.php:67
__construct(array $settings=null)
Определения settingsbase.php:23
prefixFor($entityTypeId)
Определения settingsbase.php:79
resolveName($entityTypeId)
Определения settingsbase.php:37
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35