1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
iblocksettings.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Iblock\Grid\Entity;
4
5
use Bitrix\Iblock\IblockTable;
6
use Bitrix\Main;
7
use Bitrix\Main\ArgumentException;
8
use Bitrix\Main\Config\Option;
9
use Bitrix\Main\SystemException;
10
11
class
IblockSettings
extends
Main\Grid\Settings
12
{
13
protected
array
$iblockFields
;
14
15
private
int
$iblockId;
16
private
string
$iblockTypeId;
17
private
string
$listMode;
18
private
bool
$isAllowedIblockSections =
false
;
19
private
bool
$isShowedXmlId =
false
;
20
21
public
function
__construct
(
array
$params
)
22
{
23
parent::__construct(
$params
);
24
25
$this->iblockId =
$params
[
'IBLOCK_ID'
] ?? 0;
26
if
($this->iblockId === 0)
27
{
28
throw
new
ArgumentException
(
'Collection does not contain value for iblock id.'
,
'params'
);
29
}
30
31
$this->
init
();
32
}
33
34
protected
function
init
(): void
35
{
36
$this->iblockFields =
IblockTable::getRow
([
37
'select'
=> [
38
'*'
,
39
'TYPE_SECTIONS'
=>
'TYPE.SECTIONS'
,
40
],
41
'filter'
=> [
42
'=ID'
=> $this->iblockId,
43
'=ACTIVE'
=>
'Y'
,
44
],
45
]);
46
if
(empty($this->iblockFields))
47
{
48
throw
new
SystemException
(
'Not found active iblock'
);
49
}
50
51
$this->iblockTypeId = $this->iblockFields[
'IBLOCK_TYPE_ID'
];
52
$this->
isAllowedIblockSections
= $this->iblockFields[
'TYPE_SECTIONS'
] ===
'Y'
;
53
54
if
(
55
$this->iblockFields[
'LIST_MODE'
] ===
IblockTable::LIST_MODE_SEPARATE
56
|| $this->iblockFields[
'LIST_MODE'
] ===
IblockTable::LIST_MODE_COMBINED
57
)
58
{
59
$this->listMode = $this->iblockFields[
'LIST_MODE'
];
60
}
61
else
62
{
63
$this->listMode =
64
Option::get(
'iblock'
,
'combined_list_mode'
) ===
'Y'
65
?
IblockTable::LIST_MODE_COMBINED
66
:
IblockTable::LIST_MODE_SEPARATE
67
;
68
}
69
}
70
71
public
function
getIblockId
(): int
72
{
73
return
$this->iblockId
;
74
}
75
76
public
function
getIblockTypeId
(): string
77
{
78
return
$this->iblockTypeId
;
79
}
80
81
public
function
getListMode
(): string
82
{
83
return
$this->listMode;
84
}
85
86
public
function
setListMode
(
string
$value): self
87
{
88
$this->listMode = $value;
89
90
return
$this;
91
}
92
93
public
function
isAllowedIblockSections
(): bool
94
{
95
return
$this->isAllowedIblockSections;
96
}
97
98
public
function
setAllowedIblockSections
(
bool
$value): self
99
{
100
$this->
isAllowedIblockSections
= $value;
101
102
return
$this;
103
}
104
105
public
function
isShowedXmlId
(): bool
106
{
107
return
$this->isShowedXmlId;
108
}
109
110
public
function
setShowedXmlId
(
bool
$value): self
111
{
112
$this->
isShowedXmlId
= $value;
113
114
return
$this;
115
}
116
}
Bitrix\Iblock\Grid\Entity\IblockSettings
Определения
iblocksettings.php:12
Bitrix\Iblock\Grid\Entity\IblockSettings\$iblockFields
array $iblockFields
Определения
iblocksettings.php:13
Bitrix\Iblock\Grid\Entity\IblockSettings\getIblockId
getIblockId()
Определения
iblocksettings.php:71
Bitrix\Iblock\Grid\Entity\IblockSettings\setAllowedIblockSections
setAllowedIblockSections(bool $value)
Определения
iblocksettings.php:98
Bitrix\Iblock\Grid\Entity\IblockSettings\getIblockTypeId
getIblockTypeId()
Определения
iblocksettings.php:76
Bitrix\Iblock\Grid\Entity\IblockSettings\init
init()
Определения
iblocksettings.php:34
Bitrix\Iblock\Grid\Entity\IblockSettings\__construct
__construct(array $params)
Определения
iblocksettings.php:21
Bitrix\Iblock\Grid\Entity\IblockSettings\getListMode
getListMode()
Определения
iblocksettings.php:81
Bitrix\Iblock\Grid\Entity\IblockSettings\setListMode
setListMode(string $value)
Определения
iblocksettings.php:86
Bitrix\Iblock\Grid\Entity\IblockSettings\setShowedXmlId
setShowedXmlId(bool $value)
Определения
iblocksettings.php:110
Bitrix\Iblock\Grid\Entity\IblockSettings\isShowedXmlId
isShowedXmlId()
Определения
iblocksettings.php:105
Bitrix\Iblock\Grid\Entity\IblockSettings\isAllowedIblockSections
isAllowedIblockSections()
Определения
iblocksettings.php:93
Bitrix\Iblock\IblockTable\LIST_MODE_COMBINED
const LIST_MODE_COMBINED
Определения
iblocktable.php:95
Bitrix\Iblock\IblockTable\LIST_MODE_SEPARATE
const LIST_MODE_SEPARATE
Определения
iblocktable.php:94
Bitrix\Main\ArgumentException
Определения
ArgumentException.php:9
Bitrix\Main\Grid\Settings
Определения
settings.php:8
Bitrix\Main\ORM\Data\DataManager\getRow
static getRow(array $parameters)
Определения
datamanager.php:398
Bitrix\Main\SystemException
Определения
SystemException.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$iblockTypeId
$iblockTypeId
Определения
group_lists.php:25
$iblockId
$iblockId
Определения
iblock_catalog_edit.php:30
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
iblock
lib
grid
entity
iblocksettings.php
Создано системой
1.14.0