• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/checklist/internals/checklist.php
  • Класс: BitrixTasksCheckListInternalsCheckList
  • Вызов: CheckList::updateItemsWithRecountedSortIndexes
private function updateItemsWithRecountedSortIndexes($recountedSortIndexes, $connection)
{
	$checkListDataController = $this->checkListDataController;

	$tableName = $checkListDataController::getTableName();
	$sortColumn = $checkListDataController::getSortColumnName();

	$updateSql = "
		UPDATE {$tableName}
		SET {$sortColumn} = CASE IDn
	";

	foreach ($recountedSortIndexes as $itemId => $sortIndex)
	{
		$updateSql .= "WHEN $itemId THEN $sortIndexn";
	}

	$updateSql .= "ENDnWHERE ID IN (" . implode(', ', array_keys($recountedSortIndexes)) . ")";

	$connection->query($updateSql);
}