Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
settings.php
1
<?php
2
3
namespace
Bitrix\Main\Grid
;
4
5
use
Bitrix\Main\ArgumentException
;
6
7
class
Settings
8
{
9
public
const
MODE_HTML
=
'html'
;
10
public
const
MODE_EXCEL
=
'excel'
;
11
12
private
string
$id =
''
;
13
private
string
$mode;
14
15
public
function
__construct
(array $params)
16
{
17
// for supports \Bitrix\Main\Filter\Settings
18
$this->
id
= $params[
'ID'
] ??
''
;
19
$this->mode = $params[
'MODE'
] ??
self::MODE_HTML
;
20
21
if
($this->
id
===
''
)
22
{
23
throw
new
ArgumentException
(
'Collection does not contain value for id.'
,
'params'
);
24
}
25
}
26
27
public
function
getID
(): string
28
{
29
return
$this->id;
30
}
31
32
public
function
setMode
(
string
$mode): void
33
{
34
$this->mode = $mode;
35
}
36
37
public
function
isHtmlMode
(): bool
38
{
39
return
$this->mode ===
self::MODE_HTML
;
40
}
41
42
public
function
isExcelMode
(): bool
43
{
44
return
$this->mode ===
self::MODE_EXCEL
;
45
}
46
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\Grid\Settings
Definition
settings.php:8
Bitrix\Main\Grid\Settings\MODE_HTML
const MODE_HTML
Definition
settings.php:9
Bitrix\Main\Grid\Settings\getID
getID()
Definition
settings.php:27
Bitrix\Main\Grid\Settings\isHtmlMode
isHtmlMode()
Definition
settings.php:37
Bitrix\Main\Grid\Settings\setMode
setMode(string $mode)
Definition
settings.php:32
Bitrix\Main\Grid\Settings\__construct
__construct(array $params)
Definition
settings.php:15
Bitrix\Main\Grid\Settings\MODE_EXCEL
const MODE_EXCEL
Definition
settings.php:10
Bitrix\Main\Grid\Settings\isExcelMode
isExcelMode()
Definition
settings.php:42
Bitrix\Main\Grid
modules
main
lib
grid
settings.php
Создано системой
1.10.0