1 | <?php |
||
25 | class ManagerBuilder extends AbstractBuilderCollection |
||
26 | { |
||
27 | use OptionsTrait; |
||
28 | |||
29 | const METADATA_MAPPING_ANNOTATION = Builder::METADATA_MAPPING_ANNOTATION; |
||
30 | const METADATA_MAPPING_XML = Builder::METADATA_MAPPING_XML; |
||
31 | const METADATA_MAPPING_YAML = Builder::METADATA_MAPPING_YAML; |
||
32 | const METADATA_MAPPING_PHP = Builder::METADATA_MAPPING_PHP; |
||
33 | |||
34 | const RELATIONAL_MANAGER_KEY = 'relational_manager_key'; |
||
35 | const MONGODB_MANAGER_KEY = 'mongodb_manager_key'; |
||
36 | const COUCHDB_MANAGER_KEY = 'couchdb_manager_key'; |
||
37 | |||
38 | const RELATIONAL_MANAGER_NAME = 'relational_manager_name'; |
||
39 | const MONGODB_MANAGER_NAME = 'mongodb_manager_name'; |
||
40 | const COUCHDB_MANAGER_NAME = 'couchdb_manager_name'; |
||
41 | |||
42 | /** |
||
43 | * Global annotation loader control. |
||
44 | * |
||
45 | * @var bool |
||
46 | */ |
||
47 | protected $globalLoaderRegister = true; |
||
48 | |||
49 | /** |
||
50 | * ManagerBuilder constructor. |
||
51 | * |
||
52 | * @param array $options |
||
53 | */ |
||
54 | public function __construct(array $options = []) |
||
70 | |||
71 | /** |
||
72 | * Load Doctrine managers from settings array. |
||
73 | * |
||
74 | * @param array $settings |
||
75 | * |
||
76 | * @throws \RuntimeException |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function loadSettings(array $settings) |
||
99 | |||
100 | /** |
||
101 | * Register ORM entity managers. |
||
102 | * |
||
103 | * @param array $settings |
||
104 | * |
||
105 | * @throws \RuntimeException |
||
106 | */ |
||
107 | protected function registerEntityManagers(array $settings) |
||
121 | |||
122 | /** |
||
123 | * Register MongoDB ODM document managers. |
||
124 | * |
||
125 | * @param array $settings |
||
126 | * |
||
127 | * @throws \RuntimeException |
||
128 | */ |
||
129 | protected function registerMongoDBDocumentManagers(array $settings) |
||
143 | |||
144 | /** |
||
145 | * Register CouchDB ODM document managers. |
||
146 | * |
||
147 | * @param array $settings |
||
148 | * |
||
149 | * @throws \RuntimeException |
||
150 | */ |
||
151 | protected function registerCouchDBDocumentManagers(array $settings) |
||
165 | |||
166 | /** |
||
167 | * Get registered builder's managers. |
||
168 | * |
||
169 | * @return \Doctrine\Common\Persistence\ObjectManager[] |
||
170 | */ |
||
171 | public function getManagers() |
||
184 | |||
185 | /** |
||
186 | * Get registered builder's manager. |
||
187 | * |
||
188 | * @param string $name |
||
189 | * |
||
190 | * @throws \RuntimeException |
||
191 | * |
||
192 | * @return \Doctrine\Common\Persistence\ObjectManager |
||
193 | */ |
||
194 | public function getManager($name) |
||
207 | |||
208 | /** |
||
209 | * Get console application. |
||
210 | * |
||
211 | * @return Application |
||
212 | */ |
||
213 | public function getCLIApplication() |
||
230 | |||
231 | /** |
||
232 | * Register global annotation loader. |
||
233 | * class_exists function. |
||
234 | */ |
||
235 | protected function registerGlobalAnnotationLoader() |
||
243 | } |
||
244 |