CommentsEvent.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCP\Comments;
  8. use OCP\EventDispatcher\Event;
  9. /**
  10. * Class CommentsEvent
  11. *
  12. * @since 9.0.0
  13. */
  14. class CommentsEvent extends Event {
  15. /**
  16. * @since 11.0.0
  17. * @deprecated 22.0.0
  18. */
  19. public const EVENT_ADD = 'OCP\Comments\ICommentsManager::addComment';
  20. /**
  21. * @since 11.0.0
  22. * @deprecated 22.0.0
  23. */
  24. public const EVENT_PRE_UPDATE = 'OCP\Comments\ICommentsManager::preUpdateComment';
  25. /**
  26. * @since 11.0.0
  27. * @deprecated 22.0.0
  28. */
  29. public const EVENT_UPDATE = 'OCP\Comments\ICommentsManager::updateComment';
  30. /**
  31. * @since 11.0.0
  32. * @deprecated 22.0.0
  33. */
  34. public const EVENT_DELETE = 'OCP\Comments\ICommentsManager::deleteComment';
  35. /** @var string */
  36. protected $event;
  37. /** @var IComment */
  38. protected $comment;
  39. /**
  40. * DispatcherEvent constructor.
  41. *
  42. * @param string $event
  43. * @param IComment $comment
  44. * @since 9.0.0
  45. */
  46. public function __construct($event, IComment $comment) {
  47. $this->event = $event;
  48. $this->comment = $comment;
  49. }
  50. /**
  51. * @return string
  52. * @since 9.0.0
  53. */
  54. public function getEvent() {
  55. return $this->event;
  56. }
  57. /**
  58. * @return IComment
  59. * @since 9.0.0
  60. */
  61. public function getComment() {
  62. return $this->comment;
  63. }
  64. }