diff options
Diffstat (limited to 'lib/public/Share/Exceptions/AlreadySharedException.php')
-rw-r--r-- | lib/public/Share/Exceptions/AlreadySharedException.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/public/Share/Exceptions/AlreadySharedException.php b/lib/public/Share/Exceptions/AlreadySharedException.php new file mode 100644 index 00000000000..ce58dd19e2a --- /dev/null +++ b/lib/public/Share/Exceptions/AlreadySharedException.php @@ -0,0 +1,35 @@ +<?php + +declare(strict_types=1); + +/** + * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +namespace OCP\Share\Exceptions; + +use OCP\Share\IShare; + +/** + * @since 22.0.0 + */ +class AlreadySharedException extends GenericShareException { + /** @var IShare */ + private $existingShare; + + /** + * @since 22.0.0 + */ + public function __construct(string $message, IShare $existingShare) { + parent::__construct($message); + + $this->existingShare = $existingShare; + } + + /** + * @since 22.0.0 + */ + public function getExistingShare(): IShare { + return $this->existingShare; + } +} |