• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/rest/service/storage.php
  • Класс: Bitrix\Disk\Rest\Service\Storage
  • Вызов: Storage::rename
protected function rename($id, $newName)
{
	$storage = $this->getStorageById($id);
	$securityContext = $storage->getCurrentUserSecurityContext();
	if(!$storage->getRootObject()->canRename($securityContext))
	{
		throw new AccessException;
	}
	if(!$storage->getProxyType() instanceof Disk\ProxyType\RestApp)
	{
		throw new RestException('Access denied (invalid type of storage)');
	}
	if(!$storage->rename($newName))
	{
		$this->errorCollection->add($storage->getErrors());
		return null;
	}

	return $storage;
}