AlreadySharedException.php 637 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Share\Exceptions;
  8. use OCP\Share\IShare;
  9. /**
  10. * @since 22.0.0
  11. */
  12. class AlreadySharedException extends GenericShareException {
  13. /** @var IShare */
  14. private $existingShare;
  15. /**
  16. * @since 22.0.0
  17. */
  18. public function __construct(string $message, IShare $existingShare) {
  19. parent::__construct($message);
  20. $this->existingShare = $existingShare;
  21. }
  22. /**
  23. * @since 22.0.0
  24. */
  25. public function getExistingShare(): IShare {
  26. return $this->existingShare;
  27. }
  28. }