• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/integration/bizproc/file.php
  • Класс: BitrixDiskIntegrationBizprocFile
  • Вызов: File::copy
public function copy(): Result
{
	$folder = $this->file->getParent();
	if (!$folder)
	{
		return Result::createFromErrorCode(Error::FOLDER_ERROR);
	}

	$newFile = $this->file->copyTo($folder, $this->file->getCreatedBy(), true);
	if (!$newFile)
	{
		return Result::createFromErrorCode(Error::FILE_NOT_ADDED);
	}

	return Result::createOk([
		'file' => new static($newFile),
		'diskFile' => $newFile,
		'attachmentId' => FileUserType::NEW_FILE_PREFIX . $newFile->getId(),
	]);
}