Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
fieldassembler.php
1
<?php
2
3
namespace
Bitrix\Main\Grid\Row
;
4
5
use
Bitrix\Main\Grid\Settings
;
6
21
abstract
class
FieldAssembler
22
{
28
private
array $columnIds;
29
private
?
Settings
$settings;
30
35
public
function
__construct
(array $columnIds, ?
Settings
$settings =
null
)
36
{
37
$this->columnIds = $columnIds;
38
$this->settings = $settings;
39
}
40
44
final
public
function
getColumnIds
(): array
45
{
46
return
$this->columnIds;
47
}
48
52
final
protected
function
getSettings
():
Settings
53
{
54
return
$this->settings;
55
}
56
66
public
function
clone
(array $columnIds):
FieldAssembler
67
{
68
$clone =
clone
$this;
69
$clone->columnIds = $columnIds;
70
71
return
$clone;
72
}
73
81
protected
function
prepareColumn
($value)
82
{
83
return
$value;
84
}
85
96
protected
function
prepareRow
(array $row): array
97
{
98
if
(empty($this->
getColumnIds
()))
99
{
100
return
$row;
101
}
102
103
$row[
'columns'
] ??= [];
104
105
foreach
($this->
getColumnIds
() as $columnId)
106
{
107
$row[
'columns'
][$columnId] = $this->
prepareColumn
($row[
'data'
][$columnId] ??
null
);
108
}
109
110
return
$row;
111
}
112
123
public
function
prepareRows
(array $rowList): array
124
{
125
foreach
($rowList as &$row)
126
{
127
$row = $this->
prepareRow
($row);
128
}
129
130
return
$rowList;
131
}
132
}
Bitrix\Main\Grid\Row\FieldAssembler
Definition
fieldassembler.php:22
Bitrix\Main\Grid\Row\FieldAssembler\__construct
__construct(array $columnIds, ?Settings $settings=null)
Definition
fieldassembler.php:35
Bitrix\Main\Grid\Row\FieldAssembler\prepareRows
prepareRows(array $rowList)
Definition
fieldassembler.php:123
Bitrix\Main\Grid\Row\FieldAssembler\prepareColumn
prepareColumn($value)
Definition
fieldassembler.php:81
Bitrix\Main\Grid\Row\FieldAssembler\clone
clone(array $columnIds)
Definition
fieldassembler.php:66
Bitrix\Main\Grid\Row\FieldAssembler\prepareRow
prepareRow(array $row)
Definition
fieldassembler.php:96
Bitrix\Main\Grid\Row\FieldAssembler\getColumnIds
getColumnIds()
Definition
fieldassembler.php:44
Bitrix\Main\Grid\Row\FieldAssembler\getSettings
getSettings()
Definition
fieldassembler.php:52
Bitrix\Main\Grid\Settings
Definition
settings.php:8
Bitrix\Main\Grid\Row
modules
main
lib
grid
row
fieldassembler.php
Создано системой
1.10.0