aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Settings/IDeclarativeSettingsFormWithHandlers.php
blob: 180df73d9951f0cb8a0c68eea9a99bec95693c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */

namespace OCP\Settings;

use OCP\IUser;

/**
 * @since 31.0.0
 */
interface IDeclarativeSettingsFormWithHandlers extends IDeclarativeSettingsForm {

	/**
	 * This function is called to get the current value of a specific forms field.
	 * @since 31.0.0
	 */
	public function getValue(string $fieldId, IUser $user): mixed;

	/**
	 * This function is called when a user updated a form field to persist the setting.
	 * @since 31.0.0
	 */
	public function setValue(string $fieldId, mixed $value, IUser $user): void;

}