Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
BaseSettings.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Settings\Entity
;
4
5
use
Bitrix\Im\V2\Rest\RestConvertible
;
6
use
Bitrix\Im\V2\Result
;
7
use
Bitrix\Im\V2\Settings\SettingsError
;
8
9
abstract
class
BaseSettings
implements
RestConvertible
10
{
11
protected
array
$settings
= [];
12
13
protected
?
int
$groupId
;
14
15
protected
bool
$isLoad
=
false
;
16
20
public
function
__construct
(?
int
$groupId
)
21
{
22
$this->groupId =
$groupId
;
23
}
24
25
abstract
public
function
updateSetting
(array $settingConfiguration);
26
abstract
public
function
fillDataBase
():
BaseSettings
;
27
28
// TODO return int|array
29
abstract
public
function
load
($source):
BaseSettings
;
30
34
public
function
getSettings
():
Result
35
{
36
$result =
new
Result
();
37
if
($this->groupId ===
null
)
38
{
39
return
$result->addError(
new
SettingsError
(
SettingsError::UNDEFINED_GROUP_ID
));
40
}
41
42
if
(!$this->
isLoad
())
43
{
44
$this->
load
($this->groupId);
45
}
46
47
return
$result->setResult($this->settings);
48
}
49
50
public
function
isLoad
(): bool
51
{
52
return
$this->isLoad
;
53
}
54
}
Bitrix\Im\V2\Result
Definition
Result.php:9
Bitrix\Im\V2\Settings\Entity\BaseSettings
Definition
BaseSettings.php:10
Bitrix\Im\V2\Settings\Entity\BaseSettings\updateSetting
updateSetting(array $settingConfiguration)
Bitrix\Im\V2\Settings\Entity\BaseSettings\isLoad
isLoad()
Definition
BaseSettings.php:50
Bitrix\Im\V2\Settings\Entity\BaseSettings\$groupId
int $groupId
Definition
BaseSettings.php:13
Bitrix\Im\V2\Settings\Entity\BaseSettings\load
load($source)
Bitrix\Im\V2\Settings\Entity\BaseSettings\fillDataBase
fillDataBase()
Bitrix\Im\V2\Settings\Entity\BaseSettings\__construct
__construct(?int $groupId)
Definition
BaseSettings.php:20
Bitrix\Im\V2\Settings\Entity\BaseSettings\$isLoad
bool $isLoad
Definition
BaseSettings.php:15
Bitrix\Im\V2\Settings\Entity\BaseSettings\getSettings
getSettings()
Definition
BaseSettings.php:34
Bitrix\Im\V2\Settings\Entity\BaseSettings\$settings
array $settings
Definition
BaseSettings.php:11
Bitrix\Im\V2\Settings\SettingsError
Definition
SettingsError.php:9
Bitrix\Im\V2\Settings\SettingsError\UNDEFINED_GROUP_ID
const UNDEFINED_GROUP_ID
Definition
SettingsError.php:10
Bitrix\Im\V2\Rest\RestConvertible
Definition
RestConvertible.php:6
Bitrix\Im\V2\Settings\Entity
Definition
BaseSettings.php:3
modules
im
lib
V2
Settings
Entity
BaseSettings.php
Создано системой
1.10.0