• Модуль: photogallery
  • Путь к файлу: ~/bitrix/modules/photogallery/lib/copy/integration/group.php
  • Класс: BitrixPhotogalleryCopyIntegrationGroup
  • Вызов: Group::copy
public function copy($groupId, $copiedGroupId)
{
	if (!Loader::includeModule("iblock") || !Loader::includeModule("socialnetwork"))
	{
		return;
	}

	$this->addToQueue($copiedGroupId);

	Option::set(self::MODULE_ID, self::CHECKER_OPTION.$copiedGroupId, "Y");

	$sectionName = $this->getSectionName($groupId);
	$parentSectionId = $this->getParentSectionId($groupId, $sectionName);
	$newSectionName = $this->getNewSectionName($copiedGroupId);
	if (!$parentSectionId)
	{
		return;
	}

	$queueOption = [
		"copiedGroupId" => $copiedGroupId,
		"parentSectionId" => $parentSectionId,
		"newSectionName" => $newSectionName,
	];
	Option::set(self::MODULE_ID, self::STEPPER_OPTION.$copiedGroupId, serialize($queueOption));

	$agent = CAgent::getList([], [
		"MODULE_ID" => self::MODULE_ID,
		"NAME" => GroupStepper::class."::execAgent();"
	])->fetch();
	if (!$agent)
	{
		GroupStepper::bind(1);
	}
}