]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/IPConfigAdapter.php
method refactoring & docblock
[friendica.git] / src / Core / Config / 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;
10
11 /**
12  *
13  * @author benlo
14  */
15 interface IPConfigAdapter
16 {
17         /**
18          * Loads all configuration values of a user's config family into a cached storage.
19          *
20          * @param string $uid The user_id
21          * @param string $cat The category of the configuration value
22          *
23          * @return void
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  $k             The configuration key to query
34          * @param mixed   $default_value optional, The value to return if key is not set (default: null)
35          * @param boolean $refresh       optional, If true the config is loaded from the db and not from the cache (default: false)
36          *
37          * @return mixed Stored value or null if it does not exist
38          */
39         public function get($uid, $cat, $k, $default_value = null, $refresh = false);
40
41         /**
42          * Stores a config value ($value) in the category ($family) under the key ($key)
43          * for the user_id $uid.
44          *
45          * @note Please do not store booleans - convert to 0/1 integer values!
46          *
47          * @param string $uid   The user_id
48          * @param string $cat   The category of the configuration value
49          * @param string $k     The configuration key to set
50          * @param string $value The value to store
51          *
52          * @return bool Operation success
53          */
54         public function set($uid, $cat, $k, $value);
55
56         /**
57          * Removes the configured value from the stored cache
58          * and removes it from the database.
59          *
60          * @param string $uid The user_id
61          * @param string $cat The category of the configuration value
62          * @param string $k   The configuration key to delete
63          *
64          * @return mixed
65          */
66         public function delete($uid, $cat, $k);
67 }