1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
rowtype.php
См. документацию.
1<?php
2
3namespace Bitrix\Iblock\Grid;
4
5class 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
Определения options.php:106
static parseIndexList(array $ids)
Определения rowtype.php:50
const ELEMENT
Определения rowtype.php:7
static getIndex(string $type, string|int $id)
Определения rowtype.php:15
const SECTION
Определения rowtype.php:8
static parseIndex(string $index)
Определения rowtype.php:25
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393