1
0

BeforePreferenceSetEvent.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Config;
  8. use OCP\EventDispatcher\Event;
  9. /**
  10. * @since 25.0.0
  11. */
  12. class BeforePreferenceSetEvent extends Event {
  13. protected string $userId;
  14. protected string $appId;
  15. protected string $configKey;
  16. protected string $configValue;
  17. protected bool $valid = false;
  18. /**
  19. * @since 25.0.0
  20. */
  21. public function __construct(string $userId, string $appId, string $configKey, string $configValue) {
  22. parent::__construct();
  23. $this->userId = $userId;
  24. $this->appId = $appId;
  25. $this->configKey = $configKey;
  26. $this->configValue = $configValue;
  27. }
  28. /**
  29. * @since 25.0.0
  30. */
  31. public function getUserId(): string {
  32. return $this->userId;
  33. }
  34. /**
  35. * @since 25.0.0
  36. */
  37. public function getAppId(): string {
  38. return $this->appId;
  39. }
  40. /**
  41. * @since 25.0.0
  42. */
  43. public function getConfigKey(): string {
  44. return $this->configKey;
  45. }
  46. /**
  47. * @since 25.0.0
  48. */
  49. public function getConfigValue(): string {
  50. return $this->configValue;
  51. }
  52. /**
  53. * @since 25.0.0
  54. */
  55. public function isValid(): bool {
  56. return $this->valid;
  57. }
  58. /**
  59. * @since 25.0.0
  60. */
  61. public function setValid(bool $valid): void {
  62. $this->valid = $valid;
  63. }
  64. }