• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/import/compiler/compiler.php
  • Класс: BitrixSaleLocationImportCompileris
  • Вызов: is::generateExportTreePutRussiaFiasPath
private function generateExportTreePutRussiaFiasPath($targetItem)
{
	// pre-process, cut off unwanted types (actually, streets)
	$newPath = $this->generateExportTreePutRussiaFiasPathCutForbidden($this->fiasPath);

	$i = -1;
	foreach($newPath as $item)
	{
		$i++;

		// external data
		$externals = array();
		if(strlen($item['POSTALCODE']))
			$externals['ZIP'][] = $item['POSTALCODE'];
		if(isset($this->fias2yandexCityMap[$item['AOGUID']]))
			$externals['YAMARKET'][] = $this->fias2yandexCityMap[$item['AOGUID']]['ID'];

		// type and name
		$itemType = $item['SHORTNAME'];
		$baseType = $this->sysMaps['FIAS2BASETYPE'][$itemType];
		$typeNameReplace = $baseType != 'CITY' ? $this->sysMaps['FIASTYPEREPLACE'][$itemType] : ''; // replace base type (e.g. "п" => "посёлок", "д" => "деревня", ...)
		$name = trim($item['FORMALNAME']).(strlen($typeNameReplace) ? ' '.$typeNameReplace : '');

		$this->eTreeDBRussia->insert(array(
			'TYPE_CODE' => 			$baseType,
			'FIAS_TYPE' => 			$itemType,
			'NAME' => 				$name,
			'LANGNAMES' => 			array('RU' => array('NAME' => $name)),
			'EXTERNALS' =>			$externals,
			'SOURCE' => 			self::SOURCE_FIAS,

			'SYS_CODE' => 			$this->mapETCodeAsFias($item['AOGUID']),
			'PARENT_SYS_CODE' => 	$i ? $this->mapETCodeAsFias($item['PARENTGUID']) : $this->currentRegion
		));
	}
}