]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Adapter/IPConfigAdapter.php
Merge pull request #6678 from rabuzarus/20190217_-_fix_magicLinks_mentions
[friendica.git] / src / Core / Config / Adapter / IPConfigAdapter.php
1 <?php
2
3 /*
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.
7  */
8
9 namespace Friendica\Core\Config\Adapter;
10
11 /**
12  *
13  * @author benlo
14  */
15 interface IPConfigAdapter
16 {
17         /**
18          * Loads all configuration values of a user's config family and returns the loaded category as an array.
19          *
20          * @param string $uid The user_id
21          * @param string $cat The category of the configuration value
22          *
23          * @return array
24          */
25         public function load($uid, $cat);
26
27         /**
28          * Get a particular user's config variable given the category name
29          * ($family) and a key.
30          *
31          * @param string  $uid           The user_id
32          * @param string  $cat           The category of the configuration value
33          * @param string  $key           The configuration key to query
34          *
35          * @return mixed Stored value or "!<unset>!" if it does not exist
36          */
37         public function get($uid, $cat, $key);
38
39         /**
40          * Stores a config value ($value) in the category ($family) under the key ($key)
41          * for the user_id $uid.
42          *
43          * @note Please do not store booleans - convert to 0/1 integer values!
44          *
45          * @param string $uid   The user_id
46          * @param string $cat   The category of the configuration value
47          * @param string $key   The configuration key to set
48          * @param string $value The value to store
49          *
50          * @return bool Operation success
51          */
52         public function set($uid, $cat, $key, $value);
53
54         /**
55          * Removes the configured value from the stored cache
56          * and removes it from the database.
57          *
58          * @param string $uid The user_id
59          * @param string $cat The category of the configuration value
60          * @param string $key The configuration key to delete
61          *
62          * @return bool
63          */
64         public function delete($uid, $cat, $key);
65
66         /**
67          * Checks, if the current adapter is connected to the backend
68          *
69          * @return bool
70          */
71         public function isConnected();
72
73         /**
74          * Checks, if a config key ($key) in the category ($cat) is already loaded for the user_id $uid.
75          *
76          * @param string $uid The user_id
77          * @param string $cat The configuration category
78          * @param string $key The configuration key
79          *
80          * @return bool
81          */
82         public function isLoaded($uid, $cat, $key);
83 }