1 | <?php namespace Comodojo\Foundation\Base; |
||
21 | trait ConfigurationParametersTrait { |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $parameters = []; |
||
27 | |||
28 | /** |
||
29 | * Get parameter (property) from stack |
||
30 | * |
||
31 | * This method supports nesting of properties using dot notation |
||
32 | * |
||
33 | * @example Configuration::get("authentication.ldap.server") |
||
34 | * @param string $parameter |
||
35 | * @return mixed|null |
||
36 | */ |
||
37 | 6 | public function get($parameter=null) { |
|
44 | |||
45 | /** |
||
46 | * Set a parameter (property) |
||
47 | * |
||
48 | * This method supports nesting of properties using dot notation |
||
49 | * |
||
50 | * @example Configuration::set("authentication.ldap.server", "192.168.1.1") |
||
51 | * @param string $parameter |
||
52 | * @return self |
||
53 | */ |
||
54 | 2 | public function set($parameter, $value) { |
|
65 | |||
66 | /** |
||
67 | * Check if parameter (property) is defined in current stack |
||
68 | * |
||
69 | * This method supports nesting of properties using dot notation |
||
70 | * |
||
71 | * @example Configuration::has("authentication.ldap.server") |
||
72 | * @param string $parameter |
||
73 | * @return bool |
||
74 | */ |
||
75 | 3 | public function has($parameter) { |
|
80 | |||
81 | /** |
||
82 | * Remove (delete) parameter (property) from stack |
||
83 | * |
||
84 | * This method supports nesting of properties using dot notation |
||
85 | * |
||
86 | * @example Configuration::delete("authentication.ldap.server") |
||
87 | * @param string $parameter |
||
88 | * @return bool |
||
89 | */ |
||
90 | 3 | public function delete($parameter = null) { |
|
106 | |||
107 | 7 | protected function getFromParts(array $parts) { |
|
128 | |||
129 | 2 | protected function setFromParts(array $parts, $value) { |
|
154 | |||
155 | 2 | protected function deleteFromParts(array $parts) { |
|
174 | |||
175 | 7 | protected static function splitParts($parameter) { |
|
180 | |||
181 | } |
||
182 |