1 | <?php |
||
16 | abstract class AbstractFacade implements FacadeContract |
||
17 | { |
||
18 | /** |
||
19 | * Config manager. |
||
20 | * |
||
21 | * @var ManagerContract |
||
22 | */ |
||
23 | protected $config; |
||
24 | |||
25 | /** |
||
26 | * The parent key of this Facade's config entries. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $parentKey = null; |
||
31 | |||
32 | /** |
||
33 | * Construct a new Facade and pass in the config. |
||
34 | * |
||
35 | * @param ManagerContract $config |
||
36 | * |
||
37 | * @author Glenn McEwan <[email protected]> |
||
38 | */ |
||
39 | 2 | public function __construct(ManagerContract $config) |
|
43 | |||
44 | /** |
||
45 | * Get a value from the config. |
||
46 | * Decorated to pull from the parent if this Facade uses a parent key. |
||
47 | * |
||
48 | * @param string $key The Config key to fetch the value for |
||
49 | * @param mixed $default the default, if the config key does not exist |
||
50 | * |
||
51 | * @return mixed the config value, could be a string, array, etc |
||
52 | * |
||
53 | * @author Glenn McEwan <[email protected]> |
||
54 | */ |
||
55 | 2 | public function get($key, $default = null) |
|
63 | |||
64 | /** |
||
65 | * When fetching config entries from this facade, |
||
66 | * are they nested under one parent / head key? |
||
67 | * |
||
68 | * @return bool |
||
69 | * |
||
70 | * @author Glenn McEwan <[email protected]> |
||
71 | */ |
||
72 | 2 | protected function isNested() |
|
76 | } |
||
77 |