• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/file.php
  • Класс: BitrixDiskFile
  • Вызов: File::restore
public function restore($restoredBy)
{
	if (!$this->isDeleted())
	{
		return true;
	}

	$needRecalculate = $this->deletedType == ObjectTable::DELETED_TYPE_CHILD;
	$status = parent::restoreInternal($restoredBy);
	if($status && $needRecalculate)
	{
		$this->recalculateDeletedTypeAfterRestore($restoredBy);
	}
	if($status)
	{
		$driver = Driver::getInstance();
		if ($this->getStorage()->isUseInternalRights())
		{
			$driver->getRecentlyUsedManager()->push(
				$restoredBy,
				$this
			);
		}
		$driver->getIndexManager()->indexFileByModuleSearch($this);
		$driver->sendChangeStatusToSubscribers($this);

		//it's necessary to reset cache because in default way BitrixDiskDriver::sendChangeStatusToSubscribers
		// doesn't reset tree cache when send notification on the file. But in case when we restore file - we have to.
		//The reason is that we can restore folder when we restore the file.
		$subscribers = Driver::getInstance()->collectSubscribers($this);
		Driver::getInstance()->cleanCacheTreeBitrixDisk(array_keys($subscribers));
	}

	return $status;
}