CCrmExternalSaleImport::ParseOrderDataOrderContractorsAddress

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmExternalSaleImport
  4. ParseOrderDataOrderContractorsAddress
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_external_sale_import.php
  • Класс: \CCrmExternalSaleImport
  • Вызов: CCrmExternalSaleImport::ParseOrderDataOrderContractorsAddress
private function ParseOrderDataOrderContractorsAddress($document)
{
	$arResult = array();

	if (isset($document["View"]))
		$arResult["VIEW"] = $document["View"][0]["#"];

	if (is_array($document["AddressField"]))
	{
		foreach ($document["AddressField"] as $arAddressField)
		{
			$fieldType = null;
			$fieldValue = null;

			$arAddressField = $arAddressField["#"];
			foreach ($arAddressField as $key => $value)
			{
				$value = $value[0]["#"];
				switch ($key)
				{
					case 'Type':
						$fieldType = $value;
						break;
					case 'Value':
						$fieldValue = $value;
						break;
				}
			}

			if ($fieldType != null)
				$arResult[$fieldType] = $fieldValue;
		}
	}

	return $arResult;
}

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