12 private int $iblockId;
14 public function __construct(
int $iblockId, array $excludeColumnsIds)
16 $this->iblockId = $iblockId;
19 $this->getPropertyColumnsIds($excludeColumnsIds)
23 private function getPropertyColumnsIds(array $excludeColumnsIds): array
32 '=IBLOCK_ID' => $this->iblockId,
37 foreach ($rows as $row)
39 $columnId = ElementPropertyProvider::getColumnIdByPropertyId((
int)$row[
'ID']);
40 if (!in_array($columnId, $excludeColumnsIds,
true))
42 $result[] = $columnId;
52 if (empty($columnIds))
57 $row[
'columns'] ??= [];
59 foreach ($columnIds as $columnId)
61 $value = $this->getFlatColumnValues($row[
'data'][$columnId] ??
null);
64 $value = join(
' / ', $value);
66 $value = Main\Text\HtmlFilter::encode((
string)$value);
68 $row[
'columns'][$columnId] ??= $value;
69 $row[
'data'][
'~' . $columnId] ??= $value;
75 private static function getFlatColumnValues(mixed $rawValues)
77 if (!is_array($rawValues))
81 if (array_key_exists(
'VALUE', $rawValues))
83 return $rawValues[
'VALUE'];
88 foreach ($rawValues as $row)
90 if (is_array($row) && array_key_exists(
'VALUE', $row))
92 $result[] = $row[
'VALUE'];
static getList(array $parameters=array())