ShareLinkAccessedEvent.php 997 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 OCA\Files_Sharing\Event;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\Share\IShare;
  10. class ShareLinkAccessedEvent extends Event {
  11. /** @var IShare */
  12. private $share;
  13. /** @var string */
  14. private $step;
  15. /** @var int */
  16. private $errorCode;
  17. /** @var string */
  18. private $errorMessage;
  19. public function __construct(IShare $share, string $step = '', int $errorCode = 200, string $errorMessage = '') {
  20. parent::__construct();
  21. $this->share = $share;
  22. $this->step = $step;
  23. $this->errorCode = $errorCode;
  24. $this->errorMessage = $errorMessage;
  25. }
  26. public function getShare(): IShare {
  27. return $this->share;
  28. }
  29. public function getStep(): string {
  30. return $this->step;
  31. }
  32. public function getErrorCode(): int {
  33. return $this->errorCode;
  34. }
  35. public function getErrorMessage(): string {
  36. return $this->errorMessage;
  37. }
  38. }