Subversion Repositories oidplus

Rev

Rev 1086 | Rev 1130 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1086 Rev 1116
Line 28... Line 28...
28
// Not to be confused with OIDplusConfig which are settings that are stored in the database.
28
// Not to be confused with OIDplusConfig which are settings that are stored in the database.
29
class OIDplusBaseConfig extends OIDplusBaseClass implements OIDplusGetterSetterInterface {
29
class OIDplusBaseConfig extends OIDplusBaseClass implements OIDplusGetterSetterInterface {
30
 
30
 
31
        protected $data = array();
31
        protected $data = array();
32
 
32
 
-
 
33
        /**
-
 
34
         * @param string $name
-
 
35
         * @param mixed|null $default
-
 
36
         * @return mixed|null
-
 
37
         */
33
        public function getValue($name, $default=null) {
38
        public function getValue(string $name, $default=null) {
34
                return $this->exists($name) ? $this->data[$name] : $default;
39
                return $this->exists($name) ? $this->data[$name] : $default;
35
        }
40
        }
36
 
41
 
-
 
42
        /**
-
 
43
         * @param string $name
-
 
44
         * @param mixed $value
-
 
45
         * @return void
-
 
46
         */
37
        public function setValue($name, $value) {
47
        public function setValue(string $name, $value) {
38
                // Note: The value is only set at run time level!
48
                // Note: The value is only set at run time level!
39
                // This function will NOT change the userdata/baseconfig/config.inc.php file!
49
                // This function will NOT change the userdata/baseconfig/config.inc.php file!
40
                $this->data[$name] = $value;
50
                $this->data[$name] = $value;
41
        }
51
        }
42
 
52
 
-
 
53
        /**
-
 
54
         * @param string $name
-
 
55
         * @return void
-
 
56
         */
43
        public function delete($name) {
57
        public function delete(string $name) {
44
                // Note: The value is only deleted at run time level!
58
                // Note: The value is only deleted at run time level!
45
                // This function will NOT change the userdata/baseconfig/config.inc.php file!
59
                // This function will NOT change the userdata/baseconfig/config.inc.php file!
46
                unset($this->data[$name]);
60
                unset($this->data[$name]);
47
        }
61
        }
48
 
62
 
-
 
63
        /**
-
 
64
         * @param string $name
-
 
65
         * @return bool
-
 
66
         */
49
        public function exists($name) {
67
        public function exists(string $name): bool {
50
                return isset($this->data[$name]);
68
                return isset($this->data[$name]);
51
        }
69
        }
52
 
70
 
53
}
71
}