- Модуль: sale
- Путь к файлу: ~/bitrix/modules/sale/lib/location/import/compiler/compiler.php
- Класс: BitrixSaleLocationImportCompileris
- Вызов: is::dropFiasTreeDuplicates
public function dropFiasTreeDuplicates()
{
foreach(new DirectoryIterator($this->getPoolDirName('fias_tree')) as $file)
{
if($file->isDot() || $file->isDir())
continue;
$csv = $this->getDataFromCSV('fias_tree', str_replace('.csv', '', $file->getFilename()));
$index = array();
foreach($csv as $id => $line)
{
if(isset($index[$line['ID']]))
{
unset($csv[$id]);
continue;
}
$index[$line['ID']] = true;
}
$this->putDataToCSV($csv, 'fias_tree', str_replace('.csv', '', $file->getFilename()));
unset($index);
unset($csv);
}
}