1
0

DeclarativeSettingsSetValueEvent.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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\Settings\Events;
  8. use OCP\EventDispatcher\Event;
  9. use OCP\IUser;
  10. use OCP\Settings\IDeclarativeSettingsForm;
  11. /**
  12. * @psalm-import-type DeclarativeSettingsValueTypes from IDeclarativeSettingsForm
  13. *
  14. * @since 29.0.0
  15. */
  16. class DeclarativeSettingsSetValueEvent extends Event {
  17. /**
  18. * @param DeclarativeSettingsValueTypes $value
  19. * @since 29.0.0
  20. */
  21. public function __construct(
  22. private IUser $user,
  23. private string $app,
  24. private string $formId,
  25. private string $fieldId,
  26. private mixed $value,
  27. ) {
  28. parent::__construct();
  29. }
  30. /**
  31. * @since 29.0.0
  32. */
  33. public function getUser(): IUser {
  34. return $this->user;
  35. }
  36. /**
  37. * @since 29.0.0
  38. */
  39. public function getApp(): string {
  40. return $this->app;
  41. }
  42. /**
  43. * @since 29.0.0
  44. */
  45. public function getFormId(): string {
  46. return $this->formId;
  47. }
  48. /**
  49. * @since 29.0.0
  50. */
  51. public function getFieldId(): string {
  52. return $this->fieldId;
  53. }
  54. /**
  55. * @since 29.0.0
  56. */
  57. public function getValue(): mixed {
  58. return $this->value;
  59. }
  60. }