• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/search/word.php
  • Класс: BitrixSaleLocationSearchWordTable
  • Вызов: WordTable::resort
public function resort()
{
	$res = MainHttpApplication::getConnection()->query(
		MainHttpApplication::getConnection()->getSqlHelper()->getTopSql("select ID, WORD from ".static::getTableName()." order by WORD asc, ID asc", self::STEP_SIZE, intval($this->procData['OFFSET']))
	);

	$cnt = 0;
	while($item = $res->fetch())
	{
		$this->procData['POSITION']++;

		$this->dictionaryResorter->insert(array(
			'WORD_ID' => $item['ID'],
			'POSITION' => $this->procData['POSITION']
		));

		$cnt++;
	}

	$this->procData['OFFSET'] += static::STEP_SIZE;

	$this->dictionaryResorter->flush();

	return !$cnt;
}