| 1 | <?php |
||
| 5 | class Manager |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * An array of settings that have been... set |
||
| 9 | * |
||
| 10 | * @var array $settings |
||
| 11 | */ |
||
| 12 | protected $settings = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Check and see if the requested setting is a valid, registered setting |
||
| 16 | * |
||
| 17 | * @param string $name |
||
| 18 | * |
||
| 19 | * @return boolean |
||
| 20 | */ |
||
| 21 | 48 | public function exists($name) |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Add a setting |
||
| 28 | * |
||
| 29 | * @param string $name |
||
| 30 | * @param mixed $value |
||
| 31 | */ |
||
| 32 | 44 | public function add($name, $value) |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Get the value of the requested setting if it exists |
||
| 47 | * |
||
| 48 | * @param string $key |
||
| 49 | * |
||
| 50 | * @return mixed |
||
| 51 | */ |
||
| 52 | 80 | public function get($key) |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Get the short name for the requested settings class |
||
| 63 | * |
||
| 64 | * @param string $name |
||
| 65 | * |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | 48 | protected function getPath($name) |
|
| 72 | |||
| 73 | /** |
||
| 74 | * Get the short class name for the setting |
||
| 75 | * |
||
| 76 | * @param string $name |
||
| 77 | * |
||
| 78 | * @return string |
||
| 79 | */ |
||
| 80 | 48 | protected function getClassName($name) |
|
| 84 | } |
||
| 85 |