1 | <?php |
||
31 | class EntityManagerBuilder |
||
32 | { |
||
33 | use ObjectManagerTrait; |
||
34 | |||
35 | /** |
||
36 | * Default configuration options. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected static $defaultOptions = [ |
||
41 | 'connection' => null, |
||
42 | 'cache_driver' => null, |
||
43 | 'cache_namespace' => null, |
||
44 | 'annotation_files' => [], |
||
45 | 'annotation_namespaces' => [], |
||
46 | 'annotation_autoloaders' => [], |
||
47 | 'annotation_paths' => null, |
||
48 | 'xml_paths' => null, |
||
49 | 'yaml_paths' => null, |
||
50 | 'php_paths' => null, |
||
51 | 'naming_strategy' => null, |
||
52 | 'quote_strategy' => null, |
||
53 | 'proxy_path' => null, |
||
54 | 'proxies_namespace' => 'DoctrineORMProxy', |
||
55 | 'auto_generate_proxies' => AbstractProxyFactory::AUTOGENERATE_NEVER, |
||
56 | 'sql_logger' => null, |
||
57 | 'event_manager' => null, |
||
58 | 'custom_types' => [], |
||
59 | 'string_functions' => [], |
||
60 | 'numeric_functions' => [], |
||
61 | 'datetime_functions' => [], |
||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * Create a Doctrine entity manager. |
||
66 | * |
||
67 | * @param array $options |
||
68 | * |
||
69 | * @throws \Doctrine\DBAL\DBALException |
||
70 | * @throws \Doctrine\ORM\ORMException |
||
71 | * @throws \InvalidArgumentException |
||
72 | * @throws \RuntimeException |
||
73 | * |
||
74 | * @return \Doctrine\ORM\EntityManager |
||
75 | */ |
||
76 | public static function build(array $options) |
||
101 | |||
102 | /** |
||
103 | * Create Doctrine ORM bare configuration. |
||
104 | * |
||
105 | * @param array $options |
||
106 | * |
||
107 | * @throws \InvalidArgumentException |
||
108 | * |
||
109 | * @return \Doctrine\ORM\Configuration |
||
110 | */ |
||
111 | protected static function getConfiguration(array $options) |
||
125 | |||
126 | /** |
||
127 | * Create Doctrine ODM configuration. |
||
128 | * |
||
129 | * @param \Doctrine\ORM\Configuration $config |
||
130 | * @param array $options |
||
131 | * |
||
132 | * @throws \RuntimeException |
||
133 | */ |
||
134 | protected static function setupMetadataDriver(Configuration $config, array $options) |
||
141 | |||
142 | /** |
||
143 | * @param \Doctrine\ORM\Configuration $config |
||
144 | * @param array $options |
||
145 | * |
||
146 | * @throws \RuntimeException |
||
147 | * |
||
148 | * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver |
||
|
|||
149 | */ |
||
150 | protected static function getMetadataDriver(Configuration $config, array $options) |
||
173 | |||
174 | /** |
||
175 | * Setup naming strategy. |
||
176 | * |
||
177 | * @param \Doctrine\ORM\Configuration $config |
||
178 | * @param array $options |
||
179 | * |
||
180 | * @throws \InvalidArgumentException |
||
181 | */ |
||
182 | protected static function setupNamingStrategy(Configuration $config, array $options) |
||
191 | |||
192 | /** |
||
193 | * Setup quote strategy. |
||
194 | * |
||
195 | * @param \Doctrine\ORM\Configuration $config |
||
196 | * @param array $options |
||
197 | * |
||
198 | * @throws \InvalidArgumentException |
||
199 | */ |
||
200 | protected static function setupQuoteStrategy(Configuration $config, array $options) |
||
209 | |||
210 | /** |
||
211 | * Setup SQL logger. |
||
212 | * |
||
213 | * @param \Doctrine\ORM\Configuration $config |
||
214 | * @param array $options |
||
215 | */ |
||
216 | protected static function setupSQLLogger(Configuration $config, array $options) |
||
222 | |||
223 | /** |
||
224 | * Setup custom DQL functions. |
||
225 | * |
||
226 | * @param \Doctrine\ORM\Configuration $config |
||
227 | * @param array $options |
||
228 | */ |
||
229 | protected static function setupCustomDQLFunctions(Configuration $config, array $options) |
||
237 | |||
238 | /** |
||
239 | * Setup Custom DBAL types. |
||
240 | * |
||
241 | * @param \Doctrine\DBAL\Connection $connection |
||
242 | * @param array $options |
||
243 | * |
||
244 | * @throws \Doctrine\DBAL\DBALException |
||
245 | * @throws \RuntimeException |
||
246 | */ |
||
247 | protected static function setupCustomDBALTypes(Connection $connection, array $options) |
||
260 | } |
||
261 |
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.