4 * To change this license header, choose License Headers in Project Properties.
5 * To change this template file, choose Tools | Templates
6 * and open the template in the editor.
9 namespace Friendica\Core\Config\Adapter;
15 interface IPConfigAdapter
18 * Loads all configuration values of a user's config family and returns the loaded category as an array.
20 * @param string $uid The user_id
21 * @param string $cat The category of the configuration value
25 public function load($uid, $cat);
28 * Get a particular user's config variable given the category name
29 * ($family) and a key.
31 * Note: Boolean variables are defined as 0/1 in the database
33 * @param string $uid The user_id
34 * @param string $cat The category of the configuration value
35 * @param string $key The configuration key to query
37 * @return null|mixed Stored value or null if it does not exist
39 public function get($uid, $cat, $key);
42 * Stores a config value ($value) in the category ($family) under the key ($key)
43 * for the user_id $uid.
45 * @note Please do not store booleans - convert to 0/1 integer values!
47 * @param string $uid The user_id
48 * @param string $cat The category of the configuration value
49 * @param string $key The configuration key to set
50 * @param string $value The value to store
52 * @return bool Operation success
54 public function set($uid, $cat, $key, $value);
57 * Removes the configured value from the stored cache
58 * and removes it from the database.
60 * @param string $uid The user_id
61 * @param string $cat The category of the configuration value
62 * @param string $key The configuration key to delete
64 * @return bool Operation success
66 public function delete($uid, $cat, $key);
69 * Checks, if the current adapter is connected to the backend
73 public function isConnected();
76 * Checks, if a config key ($key) in the category ($cat) is already loaded for the user_id $uid.
78 * @param string $uid The user_id
79 * @param string $cat The configuration category
80 * @param string $key The configuration key
84 public function isLoaded($uid, $cat, $key);