1
0

BeforeShareCreatedEvent.php 759 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Share\Events;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\Share\IShare;
  10. /**
  11. * @since 28.0.0
  12. */
  13. class BeforeShareCreatedEvent extends Event {
  14. private ?string $error = null;
  15. /**
  16. * @since 28.0.0
  17. */
  18. public function __construct(
  19. private IShare $share,
  20. ) {
  21. parent::__construct();
  22. }
  23. /**
  24. * @since 28.0.0
  25. */
  26. public function getShare(): IShare {
  27. return $this->share;
  28. }
  29. /**
  30. * @since 28.0.0
  31. */
  32. public function setError(string $error): void {
  33. $this->error = $error;
  34. }
  35. /**
  36. * @since 28.0.0
  37. */
  38. public function getError(): ?string {
  39. return $this->error;
  40. }
  41. }