1 | <?php |
||
13 | class Settings { |
||
14 | |||
15 | /** |
||
16 | * Constructs a new instance of the settings object from global state. |
||
17 | * |
||
18 | * @since 1.0 |
||
19 | * |
||
20 | * @param array $globalVariables |
||
21 | * |
||
22 | * @return Settings |
||
23 | */ |
||
24 | 24 | public static function newFromGlobals( array $globalVariables ) { |
|
25 | 24 | return new self( [ |
|
26 | 24 | self::AUTO_REFRESH => $globalVariables['egSPLAutorefresh'], |
|
27 | ] ); |
||
28 | } |
||
29 | |||
30 | const AUTO_REFRESH = 'autorefresh'; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $settings; |
||
36 | |||
37 | /** |
||
38 | * Constructor. |
||
39 | * |
||
40 | * @since 1.0 |
||
41 | * |
||
42 | * @param array $settings |
||
43 | */ |
||
44 | 28 | public function __construct( array $settings ) { |
|
47 | |||
48 | /** |
||
49 | * Returns the setting with the provided name. |
||
50 | * The specified setting needs to exist. |
||
51 | * |
||
52 | * @since 1.0 |
||
53 | * |
||
54 | * @param string $settingName |
||
55 | * |
||
56 | * @return mixed |
||
57 | */ |
||
58 | 7 | public function get( $settingName ) { |
|
61 | |||
62 | } |
||
63 |