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

	$this->errorCollection->clear();

	$status = $this->restoreByLinkObject($restoredBy);
	if (!$status)
	{
		if ($this->errorCollection->getErrorByCode(self::ERROR_RESTORE_UNDER_LINK_WRONG_TYPE))
		{
			$this->errorCollection->clear();

			$needRecalculate = $this->deletedType == ObjectTable::DELETED_TYPE_CHILD;
			$status = parent::restoreNonRecursive($restoredBy);
			if($status && $needRecalculate)
			{
				$this->recalculateDeletedTypeAfterRestore($restoredBy);
			}

			if($status)
			{
				Driver::getInstance()->sendChangeStatusToSubscribers($this);
			}
		}
	}

	return $status;
}