TaskChecklistItemHandler::updateSortIndexes

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. TaskChecklistItemHandler
  4. updateSortIndexes
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/replica/taskchecklistitemhandler.php
  • Класс: BitrixTasksReplicaTaskChecklistItemHandler
  • Вызов: TaskChecklistItemHandler::updateSortIndexes
private function updateSortIndexes($recountedSortIndexes, $connection)
{
	$sqlUpdate = "UPDATE b_tasks_checklist_items SET SORT_INDEX = CASE IDn";

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

	$sqlUpdate .= "END WHERE ID IN (".implode(', ', array_keys($recountedSortIndexes)).")";

	$connection->query($sqlUpdate);
}

Добавить комментарий