1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
rowtype.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Iblock\Grid;
4
5
class
RowType
6
{
7
public
const
ELEMENT
=
'E'
;
8
public
const
SECTION
=
'S'
;
9
15
public
static
function
getIndex
(
string
$type
,
string
|
int
$id): string
16
{
17
return
(
$type
=== self::SECTION ? self::SECTION : self::ELEMENT) . $id;
18
}
19
25
public
static
function
parseIndex
(
string
$index): ?
array
26
{
27
$re =
'/^(E|S|)(\d+)$/'
;
28
if
(preg_match($re, $index, $m))
29
{
30
$type
= ($m[1] ?:
RowType::ELEMENT
);
31
$index = (int)$m[2];
32
33
return
[
$type
, $index];
34
}
35
elseif
(is_numeric($index))
36
{
37
return
[
RowType::ELEMENT
, (int)$index];
38
}
39
40
return
null
;
41
}
42
50
public
static
function
parseIndexList
(
array
$ids):
array
51
{
52
$elementIds = [];
53
$sectionIds = [];
54
55
foreach
($ids as $id)
56
{
57
$index =
self::parseIndex
($id);
58
if
($index ===
null
)
59
{
60
continue
;
61
}
62
[
$type
, $id] = $index;
63
64
if
(
$type
=== self::ELEMENT)
65
{
66
$elementIds[] = $id;
67
}
68
else
69
{
70
$sectionIds[] = $id;
71
}
72
}
73
74
return
[$elementIds, $sectionIds];
75
}
76
}
$type
$type
Определения
options.php:106
Bitrix\Iblock\Grid\RowType
Определения
rowtype.php:6
Bitrix\Iblock\Grid\RowType\parseIndexList
static parseIndexList(array $ids)
Определения
rowtype.php:50
Bitrix\Iblock\Grid\RowType\ELEMENT
const ELEMENT
Определения
rowtype.php:7
Bitrix\Iblock\Grid\RowType\getIndex
static getIndex(string $type, string|int $id)
Определения
rowtype.php:15
Bitrix\Iblock\Grid\RowType\SECTION
const SECTION
Определения
rowtype.php:8
Bitrix\Iblock\Grid\RowType\parseIndex
static parseIndex(string $index)
Определения
rowtype.php:25
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
iblock
lib
grid
rowtype.php
Создано системой
1.14.0