Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
row.php
1
<?php
2
namespace
Bitrix\Report\VisualConstructor\Helper
;
3
4
use
Bitrix\Main\ArgumentException
;
5
use
Bitrix\Main\ArgumentNullException
;
6
use
Bitrix\Report\VisualConstructor\Entity\DashboardRow
;
7
12
class
Row
13
{
20
public
static
function
getDefaultRowLayoutMap
($positions)
21
{
22
$rowLayout = array(
23
'type'
=>
'cell-container'
,
24
'orientation'
=>
'horizontal'
,
25
'elements'
=> array()
26
);
27
foreach
($positions as $position)
28
{
29
$rowLayout[
'elements'
][] = array(
30
'type'
=>
'cell'
,
31
'id'
=> $position
32
);
33
}
34
35
return
$rowLayout;
36
}
37
38
46
public
static
function
getRowDefaultEntity
($params)
47
{
48
if
(!isset($params[
'cellIds'
]))
49
{
50
$parameter =
'cellIds'
;
51
throw
new
ArgumentException
($parameter);
52
}
53
54
$cellsIds = $params[
'cellIds'
];
55
$weight = isset($params[
'weight'
]) ? $params[
'weight'
] : 0;
56
$row =
new
DashboardRow
();
57
$layoutMap =
self::getDefaultRowLayoutMap
($cellsIds);
58
$row->setLayoutMap($layoutMap);
59
$row->setGId(
Util::generateUserUniqueId
());
60
$row->setWeight($weight);
61
62
return
$row;
63
}
64
}
Bitrix\Main\ArgumentException
Definition
exception.php:34
Bitrix\Main\ArgumentNullException
Definition
exception.php:54
Bitrix\Report\VisualConstructor\Entity\DashboardRow
Definition
dashboardrow.php:18
Bitrix\Report\VisualConstructor\Helper\Row
Definition
row.php:13
Bitrix\Report\VisualConstructor\Helper\Row\getDefaultRowLayoutMap
static getDefaultRowLayoutMap($positions)
Definition
row.php:20
Bitrix\Report\VisualConstructor\Helper\Row\getRowDefaultEntity
static getRowDefaultEntity($params)
Definition
row.php:46
Bitrix\Report\VisualConstructor\Helper\Util\generateUserUniqueId
static generateUserUniqueId($prefix='')
Definition
util.php:16
Bitrix\Report\VisualConstructor\Helper
Definition
analytic.php:2
modules
report
lib
visualconstructor
helper
row.php
Создано системой
1.10.0