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

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

	return array();
}