• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/bitrix24disk/legacy/diskstorage.php
  • Класс: BitrixDiskBitrix24DiskLegacyDiskStorage
  • Вызов: DiskStorage::renameFile
public function renameFile($name, $targetElementId, $parentDirectoryId)
{
	/** @var File $sourceFile */
	$sourceFile = File::loadById($targetElementId);
	if(!$sourceFile)
	{
		$this->errorCollection->add(array(new Error("Could not " . __METHOD__ . " by id {$targetElementId}", 111604)));
		return false;
	}
	if(!$sourceFile->canRename($this->storage->getSecurityContext($this->userId)))
	{
		throw new AccessDeniedException;
	}

	if($sourceFile->rename($name))
	{
		$this->loadTree();
		return $this->getFile(null, array('id' => $sourceFile->getId()), true);
	}
	$this->errorCollection->add(array(new Error("Could not " . __METHOD__ . ", rename", 111605)));
	$this->errorCollection->add($sourceFile->getErrors());

	return array();
}