2020-04-22 09:21:15 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2020-08-24 08:54:25 -04:00
|
|
|
|
2020-04-22 09:21:15 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2020-04-22 09:21:15 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCP\Files\Events\Node;
|
|
|
|
|
|
2024-03-08 09:08:57 -05:00
|
|
|
use OCP\Exceptions\AbortedEventException;
|
2023-11-29 13:05:35 -05:00
|
|
|
|
2020-04-22 09:21:15 -04:00
|
|
|
/**
|
|
|
|
|
* @since 20.0.0
|
|
|
|
|
*/
|
|
|
|
|
class BeforeNodeDeletedEvent extends AbstractNodeEvent {
|
2023-11-29 13:05:35 -05:00
|
|
|
/**
|
|
|
|
|
* @since 28.0.0
|
2024-03-08 09:08:57 -05:00
|
|
|
* @deprecated 29.0.0 - use OCP\Exceptions\AbortedEventException instead
|
2023-11-29 13:05:35 -05:00
|
|
|
*/
|
2024-03-28 11:13:19 -04:00
|
|
|
public function abortOperation(?\Throwable $ex = null) {
|
2024-03-08 09:08:57 -05:00
|
|
|
throw new AbortedEventException($ex?->getMessage() ?? 'Operation aborted');
|
2023-11-29 13:05:35 -05:00
|
|
|
}
|
2020-04-22 09:21:15 -04:00
|
|
|
}
|