1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
elementcountfieldassembler.php
См. документацию.
1<?php
2
4
7use CIBlockSection;
8
10{
11 public function __construct()
12 {
13 parent::__construct([
14 'ELEMENT_CNT',
15 ]);
16 }
17
18 protected function prepareRow(array $row): array
19 {
20 $value = '';
21
22 $id = (int)($row['data']['ID'] ?? 0);
23 $rowType = $row['data']['ROW_TYPE'] ?? null;
24 if ($id > 0 && $rowType === RowType::SECTION)
25 {
26 $count = (int)($row['data']['ELEMENT_CNT'] ?? 0);
27 $allCount = CIBlockSection::GetSectionElementsCount($id, ['CNT_ALL' => 'Y']);
28
29 $value = "{$count} ({$allCount})";
30 }
31
32 $row['columns'] ??= [];
33 $row['columns']['ELEMENT_CNT'] = $value;
34
35 return $row;
36 }
37}
$count
Определения admin_tab.php:4
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