64 $iblockObject = new \CIBlock;
65 $iblockId = $iblockObject->add($fields);
73 if ($iblockObject->LAST_ERROR)
75 $this->result->addError(
new Error($iblockObject->LAST_ERROR, self::IBLOCK_COPY_ERROR));
79 $this->result->addError(
new Error(
"Unknown error", self::IBLOCK_COPY_ERROR));
95 $query = \CIBlock::getList([], [
"ID" => $entityId,
"CHECK_PERMISSIONS" =>
"N"],
true);
96 $iblock = $query->fetch();
99 $iblockMessage = \CIBlock::getMessages($entityId);
100 $iblock = array_merge($iblock, $iblockMessage);
103 if ($this->targetIblockTypeId)
105 $iblock[
"IBLOCK_TYPE_ID"] = $this->targetIblockTypeId;
108 if ($this->targetSocnetGroupId)
110 $iblock[
"SOCNET_GROUP_ID"] = $this->targetSocnetGroupId;
113 if (!empty($iblock[
"PICTURE"]))
115 $iblock[
"PICTURE"] = \CFile::makeFileArray($iblock[
"PICTURE"]);
118 $iblock[
"RIGHTS"] = $this->getRights(
120 $iblock[
"RIGHTS_MODE"],
121 $iblock[
"SOCNET_GROUP_ID"]
156 foreach ($this->child as $child)
158 if ($child instanceof ElementChild)
160 $child->setEnumRatio($enumRatio);
161 $child->setSectionsRatio($sectionsRatio);
164 $results[] = $child->copy($entityId, $copiedEntityId);
166 if ($child instanceof FieldChild)
168 $enumRatio = $child->getEnumRatio();
170 if ($child instanceof SectionChild)
172 $sectionsRatio = $child->getSectionsRatio();