• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/lib/copy/implement/section.php
  • Класс: BitrixIblockCopyImplementSection
  • Вызов: Section::copyChildSections
private function copyChildSections(int $sectionId, int $copiedSectionId)
{
	if (!$this->sectionCopier)
	{
		return new Result();
	}

	$this->cleanChangedFields();

	$containerCollection = new ContainerCollection();

	$queryObject = CIBlockSection::getList([], [
		"SECTION_ID" => $sectionId, "CHECK_PERMISSIONS" => "N"], false, ["ID"]);
	while ($section = $queryObject->fetch())
	{
		$container = new Container($section["ID"]);
		$container->setParentId($copiedSectionId);
		$containerCollection[] = $container;
	}

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

	return new Result();
}