aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php')
-rw-r--r--lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php b/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php
new file mode 100644
index 00000000000..83d9402dbeb
--- /dev/null
+++ b/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php
@@ -0,0 +1,24 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Files\Events\Node;
+
+use OCP\Exceptions\AbortedEventException;
+
+/**
+ * @since 20.0.0
+ */
+class BeforeNodeDeletedEvent extends AbstractNodeEvent {
+ /**
+ * @since 28.0.0
+ * @deprecated 29.0.0 - use OCP\Exceptions\AbortedEventException instead
+ */
+ public function abortOperation(?\Throwable $ex = null) {
+ throw new AbortedEventException($ex?->getMessage() ?? 'Operation aborted');
+ }
+}