1 | <?php |
||
26 | class DocumentManagerBuilder |
||
27 | { |
||
28 | use ObjectManagerTrait; |
||
29 | |||
30 | /** |
||
31 | * Default configuration options. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected static $defaultOptions = [ |
||
36 | 'connection' => null, |
||
37 | 'cache_driver' => null, |
||
38 | 'cache_namespace' => null, |
||
39 | 'annotation_files' => [], |
||
40 | 'annotation_namespaces' => [], |
||
41 | 'annotation_autoloaders' => [], |
||
42 | 'annotation_paths' => null, |
||
43 | 'xml_paths' => null, |
||
44 | 'yaml_paths' => null, |
||
45 | 'php_paths' => null, |
||
46 | 'default_database' => null, |
||
47 | 'proxy_path' => null, |
||
48 | 'proxies_namespace' => 'DoctrineODMProxy', |
||
49 | 'auto_generate_proxies' => AbstractProxyFactory::AUTOGENERATE_NEVER, |
||
50 | 'hydrator_path' => null, |
||
51 | 'hydrators_namespace' => 'DoctrineODMHydrator', |
||
52 | 'auto_generate_hydrators' => AbstractProxyFactory::AUTOGENERATE_NEVER, |
||
53 | 'logger_callable' => null, |
||
54 | 'event_manager' => null, |
||
55 | ]; |
||
56 | |||
57 | /** |
||
58 | * Create a Doctrine document manager. |
||
59 | * |
||
60 | * @param array $options |
||
61 | * |
||
62 | * @throws \InvalidArgumentException |
||
63 | * @throws \RuntimeException |
||
64 | * |
||
65 | * @return \Doctrine\ODM\MongoDB\DocumentManager |
||
66 | */ |
||
67 | public static function build(array $options) |
||
87 | |||
88 | /** |
||
89 | * Create Doctrine ODM bare configuration. |
||
90 | * |
||
91 | * @param array $options |
||
92 | * |
||
93 | * @throws \InvalidArgumentException |
||
94 | * |
||
95 | * @return \Doctrine\ODM\MongoDB\Configuration |
||
96 | */ |
||
97 | protected static function getConfiguration(array $options) |
||
109 | |||
110 | /** |
||
111 | * Create Doctrine ODM configuration. |
||
112 | * |
||
113 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
114 | * @param array $options |
||
115 | * |
||
116 | * @throws \RuntimeException |
||
117 | */ |
||
118 | protected static function setupMetadataDriver(Configuration $config, array $options) |
||
125 | |||
126 | /** |
||
127 | * @param array $options |
||
128 | * |
||
129 | * @throws \RuntimeException |
||
130 | * |
||
131 | * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver |
||
|
|||
132 | */ |
||
133 | protected static function getMetadataDriver(array $options) |
||
153 | |||
154 | /** |
||
155 | * Setup default database. |
||
156 | * |
||
157 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
158 | * @param array $options |
||
159 | */ |
||
160 | protected static function setupDefaultDatabase(Configuration $config, array $options) |
||
166 | |||
167 | /** |
||
168 | * Setup hydrators. |
||
169 | * |
||
170 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
171 | * @param array $options |
||
172 | */ |
||
173 | protected static function setupHydrator(Configuration $config, array $options) |
||
181 | |||
182 | /** |
||
183 | * Setup logger. |
||
184 | * |
||
185 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
186 | * @param array $options |
||
187 | */ |
||
188 | protected static function setupLogger(Configuration $config, array $options) |
||
194 | |||
195 | /** |
||
196 | * Create MongoDB Connection. |
||
197 | * |
||
198 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
199 | * @param array $options |
||
200 | * |
||
201 | * @throws \InvalidArgumentException |
||
202 | * @throws \RuntimeException |
||
203 | * |
||
204 | * @return \Doctrine\MongoDB\Connection |
||
205 | */ |
||
206 | protected static function getConnection(Configuration $config, array $options) |
||
236 | } |
||
237 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.