- Модуль: catalog
- Путь к файлу: ~/bitrix/modules/catalog/lib/component/baseform.php
- Класс: BitrixCatalogComponentBaseForm
- Вызов: BaseForm::getGeneralPropertyDescription
protected function getGeneralPropertyDescription(Property $property): array
{
$type = $this->getPropertyType($property);
$description = [
'type' => $type,
'data' => [
'isProductProperty' => true,
],
];
if ($type === 'custom')
{
$name = static::preparePropertyNameFromProperty($property);
$description['data'] += $this->getCustomControlParameters($name);
}
if ($type === 'textarea')
{
$description['lineCount'] = (int)($property->getSetting('ROW_COUNT') ?? 1);
}
if ($property->getPropertyType() === PropertyTable::TYPE_LIST)
{
$description['data']['enableEmptyItem'] = true;
$description['data']['items'] = [];
$propertyEnumIterator = CIBlockProperty::GetPropertyEnum(
$property->getId(),
[
'SORT' => 'ASC',
'VALUE' => 'ASC',
'ID' => 'ASC',
]
);
while ($enum = $propertyEnumIterator->fetch())
{
$description['data']['items'][] = [
'NAME' => $enum['VALUE'],
'VALUE' => $enum['ID'],
'ID' => $enum['ID'],
];
}
if (count($description['data']['items']) === 1
&& $description['data']['items'][0]['NAME'] === 'Y')
{
$description['type'] = 'boolean';
$description['data']['value'] = $description['data']['items'][0]['VALUE'];
}
}
return $description;
}