• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/document/documentcontroller.php
  • Класс: BitrixDiskDocumentDocumentController
  • Вызов: DocumentController::processActionRename
protected function processActionRename()
{
	$this->checkRequiredPostParams(array(
		'newName'
	));
	if($this->errorCollection->hasErrors())
	{
		$this->sendJsonErrorResponse();
	}
	$this->checkUpdatePermissions();
	if(!$this->file->rename($this->request->getPost('newName')))
	{
		$this->errorCollection->add($this->file->getErrors());
		$this->sendJsonErrorResponse();
	}
	$this->sendJsonSuccessResponse([
		'object' => [
			'id' => $this->file->getId(),
		],
		'objectId' => $this->file->getId(),
		'newName' => $this->file->getName(),
	]);
}