• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/grid/row/assembler/elementcountfieldassembler.php
  • Класс: BitrixIblockGridRowAssemblerElementCountFieldAssembler
  • Вызов: ElementCountFieldAssembler::prepareRow
protected function prepareRow(array $row): array
{
	$value = '';

	$id = (int)($row['data']['ID'] ?? 0);
	$rowType = $row['data']['ROW_TYPE'] ?? null;
	if ($id > 0 && $rowType === RowType::SECTION)
	{
		$count = (int)($row['data']['ELEMENT_CNT'] ?? 0);
		$allCount = CIBlockSection::GetSectionElementsCount($id, ['CNT_ALL' => 'Y']);

		$value = "{$count} ({$allCount})";
	}

	$row['columns'] ??= [];
	$row['columns']['ELEMENT_CNT'] = $value;

	return $row;
}