Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
listconfig.php
1
<?php
2
3
namespace
Bitrix\Main\Grid\Column\Editable
;
4
5
use
Bitrix\Main\Grid\Editor\Types
;
6
7
class
ListConfig
extends
Config
8
{
9
private
array $items;
10
15
public
function
__construct
(
string
$name, array $items,
string
$type = Types::DROPDOWN)
16
{
17
parent::__construct($name, $type);
18
19
$this->items = $items;
20
}
21
27
private
function
getItemsAsDropdown(): array
28
{
29
$result = [];
30
31
foreach
($this->items as $value => $name)
32
{
33
$result[] = [
34
'VALUE'
=> $value,
35
'NAME'
=> $name,
36
];
37
}
38
39
return
$result;
40
}
41
45
public
function
toArray
(): array
46
{
47
$result = parent::toArray();
48
49
$result[
'DATA'
] = [
50
'ITEMS'
=> $this->getItemsAsDropdown(),
51
];
52
53
return
$result;
54
}
55
}
Bitrix\Main\Grid\Column\Editable\ListConfig
Definition
listconfig.php:8
Bitrix\Main\Grid\Column\Editable\ListConfig\__construct
__construct(string $name, array $items, string $type=Types::DROPDOWN)
Definition
listconfig.php:15
Bitrix\Main\Grid\Column\Editable\ListConfig\toArray
toArray()
Definition
listconfig.php:45
Bitrix\Main\Grid\Editor\Types
Definition
types.php:11
Bitrix\Main\Config
Definition
configuration.php:2
Bitrix\Main\Grid\Column\Editable
Definition
config.php:3
modules
main
lib
grid
column
editable
listconfig.php
Создано системой
1.10.0