1 | <?php |
||
27 | class DefaultConfig implements Container |
||
28 | { |
||
29 | |||
30 | private $_configurations = array(); |
||
31 | |||
32 | /** |
||
33 | * Resets all previous defined configurations |
||
34 | */ |
||
35 | public function reset() |
||
39 | |||
40 | /** |
||
41 | * Gets a pre defined Dependecy for a specific type and name. |
||
42 | * If there is only one Dependency defined for that Kind of type, the |
||
43 | * name does not matter. |
||
44 | * |
||
45 | * @param string $type currently only ClassNames with Namespaces are |
||
46 | * supported |
||
47 | * @param string $name (optional) name of the Dependency. Default is |
||
48 | * 'default' |
||
49 | * |
||
50 | * @return mixed predefined Dependency |
||
51 | */ |
||
52 | public function get($type, $name = 'default') |
||
66 | |||
67 | /** |
||
68 | * Sets a Dependency with the specified type, name and value. |
||
69 | * Please make sure, that you call this Method only in (the) config |
||
70 | * script(s). |
||
71 | * |
||
72 | * @param string $type type of the Dependency. Currently only Class |
||
73 | * names with Namespaces are supported |
||
74 | * @param string $name name of the Dependency |
||
75 | * @param mixed $value the Dependency itself |
||
76 | */ |
||
77 | public function set($type, $name, $value) |
||
89 | |||
90 | /** |
||
91 | * Bulk sets Dependencies for a given array with two levels: |
||
92 | * @example |
||
93 | * array( |
||
94 | * 'Puice\Config' => array( |
||
95 | * 'appConfig' => new MyConfig() |
||
96 | * ) |
||
97 | * ); |
||
98 | * |
||
99 | * @param array $configs bulk of dependency definitions like the |
||
100 | * example above |
||
101 | */ |
||
102 | public function bulkSet(array $configs) |
||
116 | |||
117 | } |
||
118 |