• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/checklist/internals/checklist.php
  • Класс: BitrixTasksCheckListInternalsCheckList
  • Вызов: CheckList::getNextSortIndex
private function getNextSortIndex($items)
{
	$neighbours = array_filter(
		$items,
		function ($item)
		{
			return (int)$item['PARENT_ID'] === $this->fields->getParentId();
		}
	);
	$sortIndexes = array_column($neighbours, 'SORT_INDEX');

	return (empty($sortIndexes) ? 0 : (int)max($sortIndexes) + 1);
}