Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
HasSettingsTrait.php
1
<?php
2
3
namespace
Bitrix\Catalog\v2
;
4
5
use
Bitrix\Catalog\v2\Fields\FieldStorage
;
6
7
trait HasSettingsTrait
8
{
9
protected
$settings;
10
11
private
function
getStorage():
FieldStorage
12
{
13
if
($this->settings ===
null
)
14
{
15
$this->settings =
new
FieldStorage
();
16
}
17
18
return
$this->settings;
19
}
20
25
public
function
setSettings
(array $settings): self
26
{
27
$this->getStorage()->initFields($settings);
28
29
return
$this;
30
}
31
32
public
function
getSettings
(): array
33
{
34
return
$this->getStorage()->toArray();
35
}
36
37
public
function
getSetting
(
string
$name)
38
{
39
return
$this->getStorage()->getField($name);
40
}
41
}
Bitrix\Catalog\v2\Fields\FieldStorage
Definition
FieldStorage.php:17
Bitrix\Catalog\v2
Bitrix\Catalog\v2\getSetting
getSetting(string $name)
Definition
HasSettingsTrait.php:37
Bitrix\Catalog\v2\setSettings
setSettings(array $settings)
Definition
HasSettingsTrait.php:25
Bitrix\Catalog\v2\getSettings
getSettings()
Definition
HasSettingsTrait.php:32
modules
catalog
lib
v2
HasSettingsTrait.php
Создано системой
1.10.0