• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/rest/controllers/task.php
  • Класс: BitrixTasksRestControllersTask
  • Вызов: Task::fillTreeInfo
private function fillTreeInfo(CheckList $tree): CheckList
{
	$completedCount = 0;

	foreach ($tree->getDescendants() as $descendant)
	{
		/** @var CheckList $descendant */
		$fields = $descendant->getFields();

		if ($fields['IS_COMPLETE'])
		{
			$completedCount++;
		}

		$this->fillTreeInfo($descendant);
	}

	$tree->setFields(['COMPLETED_COUNT' => $completedCount]);

	return $tree;
}