IDeclarativeSettingsFormWithHandlers.php 677 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Settings;
  8. use OCP\IUser;
  9. /**
  10. * @since 31.0.0
  11. */
  12. interface IDeclarativeSettingsFormWithHandlers extends IDeclarativeSettingsForm {
  13. /**
  14. * This function is called to get the current value of a specific forms field.
  15. * @since 31.0.0
  16. */
  17. public function getValue(string $fieldId, IUser $user): mixed;
  18. /**
  19. * This function is called when a user updated a form field to persist the setting.
  20. * @since 31.0.0
  21. */
  22. public function setValue(string $fieldId, mixed $value, IUser $user): void;
  23. }