1 | <?php |
||
18 | class Manager |
||
19 | { |
||
20 | /** |
||
21 | * @var ConfigInterface |
||
22 | */ |
||
23 | protected $config; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $dictionaries = []; |
||
29 | |||
30 | /** |
||
31 | * @param ConfigInterface $config |
||
32 | */ |
||
33 | public function __construct(ConfigInterface $config = null) |
||
39 | |||
40 | /** |
||
41 | * Returns Dictionary object |
||
42 | * |
||
43 | * @param string $name |
||
44 | * |
||
45 | * @return DictionaryInterface |
||
46 | * @throws InvalidConfigurationException |
||
47 | * @throws RuntimeException |
||
48 | */ |
||
49 | public function get(string $name): ?DictionaryInterface |
||
67 | |||
68 | /** |
||
69 | * @return ConfigInterface |
||
70 | */ |
||
71 | public function getConfig(): ?ConfigInterface |
||
75 | |||
76 | /** |
||
77 | * @param ConfigInterface $config |
||
78 | * |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function setConfig(ConfigInterface $config) |
||
87 | |||
88 | /** |
||
89 | * @param DictionaryInterface $dictionary |
||
90 | * |
||
91 | * @return $this |
||
92 | * @throws RuntimeException |
||
93 | */ |
||
94 | public function add(DictionaryInterface $dictionary) |
||
106 | |||
107 | /** |
||
108 | * @param $name |
||
109 | * @param $dictionaryConfig |
||
110 | * @return DictionaryInterface |
||
111 | * @throws InvalidConfigurationException |
||
112 | */ |
||
113 | protected function create(string $name, array $dictionaryConfig): DictionaryInterface |
||
140 | |||
141 | /** |
||
142 | * @param string $class |
||
143 | * @param array $config |
||
144 | * |
||
145 | * @return DataProviderInterface |
||
146 | * @throws InvalidConfigurationException |
||
147 | */ |
||
148 | protected function createDataProvider(string $class, array $config): DataProviderInterface |
||
162 | |||
163 | /** |
||
164 | * @param string $class |
||
165 | * |
||
166 | * @return DictionaryInterface |
||
167 | * @throws InvalidConfigurationException |
||
168 | */ |
||
169 | public function createDictionary(string $class): DictionaryInterface |
||
183 | } |
||
184 |