Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
settings.php
1<?php
2
3namespace Bitrix\Main\Grid;
4
6
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}
setMode(string $mode)
Definition settings.php:32
__construct(array $params)
Definition settings.php:15