1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
columnfactory.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Grid\Column\Factory
;
4
5
use
Bitrix\Main\Grid\Column\Column
;
6
use
Bitrix\Main\Grid\Column\Editable\Factory\ConfigFactory
;
7
use
Bitrix\Main\Grid\Column\Type
;
8
9
class
ColumnFactory
10
{
11
private
ConfigFactory
$editableConfigFactory;
12
13
public
function
__construct
()
14
{
15
$this->editableConfigFactory =
new
ConfigFactory
;
16
}
17
18
public
function
createFromArray
(
array
$params
): ?
Column
19
{
20
if
(!isset(
$params
[
'id'
]))
21
{
22
return
null
;
23
}
24
25
$id =
$params
[
'id'
];
26
27
$editable =
$params
[
'editable'
] ??
null
;
28
if
(is_array($editable))
29
{
30
$editable[
'NAME'
] ??= $id;
31
$editable[
'TYPE'
] ??= Type::getEditorType(
32
(
string
)(
$params
[
'type'
] ??
''
)
33
);
34
$params
[
'editable'
] = $this->editableConfigFactory->createFromArray($editable) ??
false
;
35
}
36
37
if
(isset(
$params
[
'width'
]))
38
{
39
if
(is_string(
$params
[
'width'
]))
40
{
41
$re =
'/^(\d+)px/'
;
42
if
(preg_match($re,
$params
[
'width'
], $m))
43
{
44
$params
[
'width'
] = (int)$m[1];
45
}
46
elseif
(is_numeric(
$params
[
'width'
]))
47
{
48
$params
[
'width'
] = (int)
$params
[
'width'
];
49
}
50
else
51
{
52
$params
[
'width'
] =
null
;
53
}
54
}
55
}
56
57
// empty string and `false` convert to `null`
58
if
(isset(
$params
[
'sort'
]) && empty(
$params
[
'sort'
]))
59
{
60
$params
[
'sort'
] =
null
;
61
}
62
63
return
new
Column
($id,
$params
);
64
}
65
}
Bitrix\Main\Grid\Column\Editable\Factory\ConfigFactory
Определения
configfactory.php:15
Bitrix\Main\Grid\Column\Factory\ColumnFactory
Определения
columnfactory.php:10
Bitrix\Main\Grid\Column\Factory\ColumnFactory\__construct
__construct()
Определения
columnfactory.php:13
Bitrix\Main\Grid\Column\Factory\ColumnFactory\createFromArray
createFromArray(array $params)
Определения
columnfactory.php:18
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main\Grid\Column\Factory
Определения
columnfactory.php:3
Bitrix\Main\Grid\Column
Определения
color.php:3
Bitrix\Main\Type
Определения
collection.php:2
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
$params
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения
template.php:799
bitrix
modules
main
lib
grid
column
factory
columnfactory.php
Создано системой
1.14.0