- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/location/import/compiler/compiler.php
- Класс: BitrixSaleLocationImportCompileris
- Вызов: is::generateExportTreePutBelorussiaBundle
private function generateExportTreePutBelorussiaBundle($bundle)
{
foreach($bundle as $id)
{
$node = $this->data['TREES']['MAIN']['NODES'][$id];
$edges = array();
if(isset($this->data['TREES']['MAIN']['EDGES'][$id]))
$edges = $this->data['TREES']['MAIN']['EDGES'][$id];
// attach to belorussia its en-name
if($node['TYPE_CODE'] == 'COUNTRY')
$node['NAME']['EN']['NAME'] = 'Belarus';
// these two types are not allowed currently, because we do not have the corresponding types in fias
if($node['TYPE_CODE'] == 'METRO_STATION' || $node['TYPE_CODE'] == 'CITY_DISTRICT')
continue;
$this->eTreeDB->insert(array(
'TYPE_CODE' => $node['TYPE_CODE'],
'NAME' => $node['NAME']['RU']['NAME'],
'LANGNAMES' => serialize($node['NAME']),
'EXTERNALS' => serialize($node['EXT']),
'SOURCE' => self::SOURCE_YANDEX,
'SYS_CODE' => $this->mapETCodeAsYandex($node['ID']),
'PARENT_SYS_CODE' => strlen($node['PARENT_ID']) ? $this->mapETCodeAsYandex($node['PARENT_ID']) : ''
));
if(!empty($edges))
$this->generateExportTreePutBelorussiaBundle($edges);
}
}