UserChangedEvent.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\User\Events;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\IUser;
  10. /**
  11. * @since 18.0.0
  12. */
  13. class UserChangedEvent extends Event {
  14. private IUser $user;
  15. private string $feature;
  16. /** @var mixed */
  17. private $value;
  18. /** @var mixed */
  19. private $oldValue;
  20. /**
  21. * @since 18.0.0
  22. */
  23. public function __construct(IUser $user,
  24. string $feature,
  25. $value,
  26. $oldValue = null) {
  27. parent::__construct();
  28. $this->user = $user;
  29. $this->feature = $feature;
  30. $this->value = $value;
  31. $this->oldValue = $oldValue;
  32. }
  33. /**
  34. * @return IUser
  35. * @since 18.0.0
  36. */
  37. public function getUser(): IUser {
  38. return $this->user;
  39. }
  40. /**
  41. * @return string
  42. * @since 18.0.0
  43. */
  44. public function getFeature(): string {
  45. return $this->feature;
  46. }
  47. /**
  48. * @return mixed
  49. * @since 18.0.0
  50. */
  51. public function getValue() {
  52. return $this->value;
  53. }
  54. /**
  55. * @return mixed
  56. * @since 18.0.0
  57. */
  58. public function getOldValue() {
  59. return $this->oldValue;
  60. }
  61. }