• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/copy/implement/template.php
  • Класс: BitrixTasksCopyImplementTemplate
  • Вызов: Template::copyChildTemplate
private function copyChildTemplate(int $templateId, int $copiedTemplateId)
{
	if (!$this->templateCopier)
	{
		return new Result();
	}

	$containerCollection = new ContainerCollection();

	$childrenIds = $this->getChildrenIds($templateId);
	foreach ($childrenIds as $childrenId)
	{
		$container = new Container($childrenId);
		$container->setParentId($copiedTemplateId);
		$containerCollection[] = $container;
	}

	if (!$containerCollection->isEmpty())
	{
		return $this->templateCopier->copy($containerCollection);
	}

	return new Result();
}