TaskChecklistItemHandler::getItems

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. TaskChecklistItemHandler
  4. getItems
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/replica/taskchecklistitemhandler.php
  • Класс: BitrixTasksReplicaTaskChecklistItemHandler
  • Вызов: TaskChecklistItemHandler::getItems
private function getItems($itemId, $connection)
{
	$itemsResult = $connection->query("
		SELECT i2.ID, i2.SORT_INDEX, PARENT_ID
		FROM b_tasks_checklist_items i1
		INNER JOIN b_tasks_checklist_items i2 on i2.TASK_ID = i1.TASK_ID
		LEFT JOIN b_tasks_checklist_items_tree ON CHILD_ID = i2.ID AND LEVEL = 1
		WHERE i1.ID = {$itemId}
		ORDER BY i2.SORT_INDEX, i2.ID
	");

	$items = [];
	while ($item = $itemsResult->fetch())
	{
		$item['PARENT_ID'] = ($item['PARENT_ID'] === null? 0 : (int)$item['PARENT_ID']);
		$items[$item['ID']] = $item;
	}

	return $items;
}

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