• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/Integration/UI/Grid/General/BaseProvider.php
  • Класс: BitrixIblockIntegrationUIGridGeneralBaseProvider
  • Вызов: BaseProvider::getRowColumns
protected function getRowColumns(array $row): array
{
	$result = [];

	$columns = $this->getColumns();
	foreach ($columns as $column)
	{
		$colName = $column['id'] ?? null;
		if (!isset($colName))
		{
			continue;
		}

		$type = $column['type'] ?? null;
		if ($type === 'list')
		{
			$value = $row[$colName] ?? null;

			$items = $column['editable']['items'] ?? null;
			if (is_array($items))
			{
				$value = $items[$value] ?? null;
			}

			$result[$colName] = $value;
		}
		elseif ($type === 'image')
		{
			$value = null;

			$fileId = (int)($row[$colName] ?? null);
			if ($fileId > 0)
			{
				$value = CFile::GetPath($fileId);
			}

			$result[$colName] = $value;
		}
		else
		{
			$result[$colName] = $row[$colName] ?? null;
		}
	}

	return $result;
}