UiFormConfiguration::getFieldIndex

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. UiFormConfiguration
  4. getFieldIndex
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/update/uiformconfiguration.php
  • Класс: BitrixCatalogUpdateUiFormConfiguration
  • Вызов: UiFormConfiguration::getFieldIndex
static function getFieldIndex(array $formSettings, string $fieldName): ?array
{
	if (
		empty($formSettings)
		|| $fieldName === ''
	)
	{
		return null;
	}

	foreach ($formSettings as $columnIndex => $column)
	{
		if (!static::isValidColumnConfig($column))
		{
			continue;
		}

		foreach ($column['elements'] as $listIndex => $list)
		{
			if (!static::isValidElementListConfig($list))
			{
				continue;
			}
			if ($list['type'] !== 'section')
			{
				continue;
			}

			foreach ($list['elements'] as $rowIndex => $row)
			{
				if (!static::isValidRowConfig($row))
				{
					continue;
				}

				if ($row['name'] === $fieldName)
				{
					return [
						'COLUMN' => $columnIndex,
						'LIST' => $listIndex,
						'ROW' => $rowIndex,
					];
				}
			}
		}
	}

	return null;
}

Добавить комментарий