3 * @copyright Copyright (C) 2010-2023, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 namespace Friendica\Core\Config\Capability;
24 use Friendica\Core\Config\Exception\ConfigPersistenceException;
27 * Interface for transactional saving of config values
28 * It buffers every set/delete until "save()" is called
30 interface ISetConfigValuesTransactionally
33 * Sets a configuration value for system config
35 * Stores a config value ($value) in the category ($cat) under the key ($key)
37 * Note: Please do not store booleans - convert to 0/1 integer values!
39 * @param string $cat The category of the configuration value
40 * @param string $key The configuration key to set
41 * @param mixed $value The value to store
43 * @return static the current instance
45 public function set(string $cat, string $key, $value): self;
48 * Deletes the given key from the system configuration.
50 * @param string $cat The category of the configuration value
51 * @param string $key The configuration key to delete
53 * @return static the current instance
56 public function delete(string $cat, string $key): self;
59 * Commits the changes of the current transaction
61 * @throws ConfigPersistenceException In case the persistence layer throws errors
63 public function commit(): void;