• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/controller/baseobject.php
  • Класс: Bitrix\Disk\Controller\BaseObject
  • Вызов: BaseObject::restore
protected function restore(Disk\BaseObject $object)
{
	$securityContext = $object->getStorage()->getSecurityContext($this->getCurrentUser()->getId());
	if (!$object->canRestore($securityContext))
	{
		$this->errorCollection[] = new Error(Loc::getMessage('DISK_ERROR_MESSAGE_DENIED'));

		return;
	}

	if (!$object->restore($this->getCurrentUser()->getId()))
	{
		$this->errorCollection->add($object->getErrors());

		return;
	}

	//@see \Bitrix\Disk\FileLink::restore and \Bitrix\Disk\BaseObject::restoreByLinkObject
	//in this case the object which we want to restore is original. We can't get symlink now.
	return $this->get(
		$object->getRealObject()
	);
}