BeforeGroupChangedEvent.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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\Group\Events;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\IGroup;
  10. /**
  11. * @since 26.0.0
  12. */
  13. class BeforeGroupChangedEvent extends Event {
  14. private IGroup $group;
  15. private string $feature;
  16. /** @var mixed */
  17. private $value;
  18. /** @var mixed */
  19. private $oldValue;
  20. /**
  21. * @since 26.0.0
  22. */
  23. public function __construct(IGroup $group,
  24. string $feature,
  25. $value,
  26. $oldValue = null) {
  27. parent::__construct();
  28. $this->group = $group;
  29. $this->feature = $feature;
  30. $this->value = $value;
  31. $this->oldValue = $oldValue;
  32. }
  33. /**
  34. *
  35. * @since 26.0.0
  36. *
  37. * @return IGroup
  38. */
  39. public function getGroup(): IGroup {
  40. return $this->group;
  41. }
  42. /**
  43. *
  44. * @since 26.0.0
  45. *
  46. * @return string
  47. */
  48. public function getFeature(): string {
  49. return $this->feature;
  50. }
  51. /**
  52. * @since 26.0.0
  53. *
  54. * @return mixed
  55. */
  56. public function getValue() {
  57. return $this->value;
  58. }
  59. /**
  60. *
  61. * @since 26.0.0
  62. *
  63. * @return mixed
  64. */
  65. public function getOldValue() {
  66. return $this->oldValue;
  67. }
  68. }