• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/cml2.php
  • Класс: CIBlockCMLImport
  • Вызов: CIBlockCMLImport::getProductFieldsFromXml
protected function getProductFieldsFromXml(array $xmlElement): array
{
	$result = [];

	if (array_key_exists($this->mess['IBLOCK_XML2_MARKING_CODE_GROUP'], $xmlElement))
	{
		$result[ProductSystemFieldMarkingCodeGroup::FIELD_ID] = $xmlElement[$this->mess['IBLOCK_XML2_MARKING_CODE_GROUP']] ?? '';
	}
	if (array_key_exists($this->mess['IBLOCK_XML2_PRODUCT_MAPPING'], $xmlElement))
	{
		$result[ProductSystemFieldProductMapping::FIELD_ID] = [];
		if (is_array($xmlElement[$this->mess['IBLOCK_XML2_PRODUCT_MAPPING']]))
		{
			foreach ($xmlElement[$this->mess['IBLOCK_XML2_PRODUCT_MAPPING']] as $value)
			{
				$value = (string)$value;
				if ($value !== '')
				{
					$result[ProductSystemFieldProductMapping::FIELD_ID][] = $value;
				}
			}
		}
	}
	if (isset($xmlElement[$this->mess['IBLOCK_XML2_WIDTH']]))
	{
		$result['WIDTH'] = $this->ToFloatEmpty($xmlElement[$this->mess['IBLOCK_XML2_WIDTH']]);
	}
	if (isset($xmlElement[$this->mess['IBLOCK_XML2_LENGTH']]))
	{
		$result['LENGTH'] = $this->ToFloatEmpty($xmlElement[$this->mess['IBLOCK_XML2_LENGTH']]);
	}
	if (isset($xmlElement[$this->mess['IBLOCK_XML2_HEIGHT']]))
	{
		$result['HEIGHT'] = $this->ToFloatEmpty($xmlElement[$this->mess['IBLOCK_XML2_HEIGHT']]);
	}

	return $result;
}