• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/migration/migrate.php
  • Класс: BitrixSaleLocationMigrationCUpdaterLocationPro
  • Вызов: CUpdaterLocationPro::convertCountries
private function convertCountries()
{
	global $DB;

	// fetch name referece, separated with lang
	$langIndex = array();
	$res = $DB->query('select * from '.self::TABLE_LOCATION_COUNTRY_NAME);
	while($item = $res->Fetch())
	{
		$langIndex[$item['COUNTRY_ID']][$item['LID']] = array(
			'NAME' => $item['NAME'],
			'SHORT_NAME' => $item['SHORT_NAME']
		);
	}

	if(is_array($this->data['LOC']['COUNTRY']))
	{
		foreach($this->data['LOC']['COUNTRY'] as $id => &$item)
		{
			$this->data['NAME'][$id] = $langIndex[$item['SUBJ_ID']];
			$this->data['TREE'][$id] = array(
				'PARENT_ID' => false,
				'TYPE_ID' => $this->data['TYPE']['COUNTRY'],
				'DEPTH_LEVEL' => 1
			);
		}
	}
	unset($this->data['LOC']['COUNTRY']);
}