1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sectioncountfieldassembler.php
См. документацию.
1<?php
2
3namespace Bitrix\Iblock\Grid\Row\Assembler;
4
5use Bitrix\Iblock\Grid\RowType;
6use Bitrix\Main\Grid\Row\FieldAssembler;
7use CIBlockSection;
8
10{
11 private int $iblockId;
12
13 public function __construct(int $iblockId)
14 {
15 parent::__construct([
16 'SECTION_CNT',
17 ]);
18
19 $this->iblockId = $iblockId;
20 }
21
22 protected function prepareRow(array $row): array
23 {
24 $value = '';
25
26 $id = (int)($row['data']['ID'] ?? 0);
27 $rowType = $row['data']['ROW_TYPE'] ?? null;
28 if ($id > 0 && $rowType === RowType::SECTION)
29 {
30 $value = CIBlockSection::GetCount([
31 'IBLOCK_ID' => $this->iblockId,
32 'SECTION_ID' => $id,
33 ]);
34 }
35
36 $row['columns'] ??= [];
37 $row['columns']['SECTION_CNT'] = $value;
38
39 return $row;
40 }
41}
const SECTION
Определения rowtype.php:8
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804