• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/replicator/template/taskproducer.php
  • Класс: BitrixTasksReplicatorTemplateTaskProducer
  • Вызов: TaskProducer::produceSubTemplates
private function produceSubTemplates(): Result
{
	$template = $this->repository->getTemplate();
	$tree = $this->buildTree();
	if (!is_array($tree[$template->getId()] ?? null))
	{
		return new Result();
	}

	foreach ($tree[$template->getId()] as $templateId)
	{
		$producer = new static(new TemplateRepository($templateId));
		$result = $producer->setParentId($this->task->getId())->produceTask();
		if (!$result->isSuccess())
		{
			return $result;
		}
	}

	return new Result();
}