commentsevent.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. *
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCP\Comments;
  23. use Symfony\Component\EventDispatcher\Event;
  24. /**
  25. * Class CommentsEvent
  26. *
  27. * @package OCP\Comments
  28. * @since 9.0.0
  29. */
  30. class CommentsEvent extends Event {
  31. const EVENT_ADD = 'OCP\Comments\ICommentsManager::addComment';
  32. const EVENT_UPDATE = 'OCP\Comments\ICommentsManager::updateComment';
  33. const EVENT_DELETE = 'OCP\Comments\ICommentsManager::deleteComment';
  34. /** @var string */
  35. protected $event;
  36. /** @var IComment */
  37. protected $comment;
  38. /**
  39. * DispatcherEvent constructor.
  40. *
  41. * @param string $event
  42. * @param IComment $comment
  43. * @since 9.0.0
  44. */
  45. public function __construct($event, IComment $comment) {
  46. $this->event = $event;
  47. $this->comment = $comment;
  48. }
  49. /**
  50. * @return string
  51. * @since 9.0.0
  52. */
  53. public function getEvent() {
  54. return $this->event;
  55. }
  56. /**
  57. * @return IComment
  58. * @since 9.0.0
  59. */
  60. public function getComment() {
  61. return $this->comment;
  62. }
  63. }