1 | <?php |
||
25 | class DocumentManagerBuilder |
||
26 | { |
||
27 | use ObjectManagerTrait; |
||
28 | |||
29 | /** |
||
30 | * Default configuration options. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | protected static $defaultOptions = [ |
||
35 | 'connection' => null, |
||
36 | 'cache_driver' => null, |
||
37 | 'cache_namespace' => null, |
||
38 | 'annotation_files' => [], |
||
39 | 'annotation_namespaces' => [], |
||
40 | 'annotation_autoloaders' => [], |
||
41 | 'annotation_paths' => null, |
||
42 | 'xml_paths' => null, |
||
43 | 'yaml_paths' => null, |
||
44 | 'php_paths' => null, |
||
45 | 'default_database' => null, |
||
46 | 'proxy_path' => null, |
||
47 | 'proxies_namespace' => 'DoctrineODMProxy', |
||
48 | 'auto_generate_proxies' => AbstractProxyFactory::AUTOGENERATE_NEVER, |
||
49 | 'hydrator_path' => null, |
||
50 | 'hydrators_namespace' => 'DoctrineODMHydrator', |
||
51 | 'auto_generate_hydrators' => AbstractProxyFactory::AUTOGENERATE_NEVER, |
||
52 | 'logger_callable' => null, |
||
53 | 'event_manager' => null, |
||
54 | ]; |
||
55 | |||
56 | /** |
||
57 | * Create a Doctrine document manager. |
||
58 | * |
||
59 | * @param array $options |
||
60 | * |
||
61 | * @throws \InvalidArgumentException |
||
62 | * @throws \RuntimeException |
||
63 | * |
||
64 | * @return \Doctrine\ODM\MongoDB\DocumentManager |
||
65 | */ |
||
66 | public static function build(array $options) |
||
86 | |||
87 | /** |
||
88 | * Create Doctrine ODM bare configuration. |
||
89 | * |
||
90 | * @param array $options |
||
91 | * |
||
92 | * @throws \InvalidArgumentException |
||
93 | * |
||
94 | * @return \Doctrine\ODM\MongoDB\Configuration |
||
95 | */ |
||
96 | protected static function getConfiguration(array $options) |
||
108 | |||
109 | /** |
||
110 | * @param array $options |
||
111 | * |
||
112 | * @throws \RuntimeException |
||
113 | * |
||
114 | * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver |
||
|
|||
115 | */ |
||
116 | protected static function getMetadataDriver(array $options) |
||
136 | |||
137 | /** |
||
138 | * Setup default database. |
||
139 | * |
||
140 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
141 | * @param array $options |
||
142 | */ |
||
143 | protected static function setupDefaultDatabase(Configuration $config, array $options) |
||
149 | |||
150 | /** |
||
151 | * Setup hydrators. |
||
152 | * |
||
153 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
154 | * @param array $options |
||
155 | */ |
||
156 | protected static function setupHydrator(Configuration $config, array $options) |
||
164 | |||
165 | /** |
||
166 | * Setup logger. |
||
167 | * |
||
168 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
169 | * @param array $options |
||
170 | */ |
||
171 | protected static function setupLogger(Configuration $config, array $options) |
||
177 | |||
178 | /** |
||
179 | * Create MongoDB Connection. |
||
180 | * |
||
181 | * @param \Doctrine\ODM\MongoDB\Configuration $config |
||
182 | * @param array $options |
||
183 | * |
||
184 | * @throws \InvalidArgumentException |
||
185 | * @throws \RuntimeException |
||
186 | * |
||
187 | * @return \Doctrine\MongoDB\Connection |
||
188 | */ |
||
189 | protected static function getConnection(Configuration $config, array $options) |
||
219 | } |
||
220 |
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.