1 | <?php |
||
30 | class EntityManagerBuilder |
||
31 | { |
||
32 | use ObjectManagerTrait; |
||
33 | |||
34 | /** |
||
35 | * Default configuration options. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | protected static $defaultOptions = [ |
||
40 | 'connection' => null, |
||
41 | 'cache_driver' => null, |
||
42 | 'cache_namespace' => null, |
||
43 | 'annotation_files' => [], |
||
44 | 'annotation_namespaces' => [], |
||
45 | 'annotation_autoloaders' => [], |
||
46 | 'annotation_paths' => null, |
||
47 | 'xml_paths' => null, |
||
48 | 'yaml_paths' => null, |
||
49 | 'php_paths' => null, |
||
50 | 'naming_strategy' => null, |
||
51 | 'quote_strategy' => null, |
||
52 | 'proxy_path' => null, |
||
53 | 'proxies_namespace' => 'DoctrineORMProxy', |
||
54 | 'auto_generate_proxies' => AbstractProxyFactory::AUTOGENERATE_NEVER, |
||
55 | 'sql_logger' => null, |
||
56 | 'event_manager' => null, |
||
57 | 'custom_types' => [], |
||
58 | 'string_functions' => [], |
||
59 | 'numeric_functions' => [], |
||
60 | 'datetime_functions' => [], |
||
61 | ]; |
||
62 | |||
63 | /** |
||
64 | * Create a Doctrine entity manager. |
||
65 | * |
||
66 | * @param array $options |
||
67 | * |
||
68 | * @throws \Doctrine\DBAL\DBALException |
||
69 | * @throws \Doctrine\ORM\ORMException |
||
70 | * @throws \InvalidArgumentException |
||
71 | * @throws \RuntimeException |
||
72 | * |
||
73 | * @return \Doctrine\ORM\EntityManager |
||
74 | */ |
||
75 | public static function build(array $options) |
||
100 | |||
101 | /** |
||
102 | * Create Doctrine ORM bare configuration. |
||
103 | * |
||
104 | * @param array $options |
||
105 | * |
||
106 | * @throws \InvalidArgumentException |
||
107 | * |
||
108 | * @return \Doctrine\ORM\Configuration |
||
109 | */ |
||
110 | protected static function getConfiguration(array $options) |
||
124 | |||
125 | /** |
||
126 | * @param array $options |
||
127 | * |
||
128 | * @throws \RuntimeException |
||
129 | * |
||
130 | * @return \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver |
||
|
|||
131 | */ |
||
132 | protected static function getMetadataDriver(array $options) |
||
152 | |||
153 | /** |
||
154 | * Setup naming strategy. |
||
155 | * |
||
156 | * @param \Doctrine\ORM\Configuration $config |
||
157 | * @param array $options |
||
158 | * |
||
159 | * @throws \InvalidArgumentException |
||
160 | */ |
||
161 | protected static function setupNamingStrategy(Configuration $config, array $options) |
||
170 | |||
171 | /** |
||
172 | * Setup quote strategy. |
||
173 | * |
||
174 | * @param \Doctrine\ORM\Configuration $config |
||
175 | * @param array $options |
||
176 | * |
||
177 | * @throws \InvalidArgumentException |
||
178 | */ |
||
179 | protected static function setupQuoteStrategy(Configuration $config, array $options) |
||
188 | |||
189 | /** |
||
190 | * Setup SQL logger. |
||
191 | * |
||
192 | * @param \Doctrine\ORM\Configuration $config |
||
193 | * @param array $options |
||
194 | */ |
||
195 | protected static function setupSQLLogger(Configuration $config, array $options) |
||
201 | |||
202 | /** |
||
203 | * Setup custom DQL functions. |
||
204 | * |
||
205 | * @param \Doctrine\ORM\Configuration $config |
||
206 | * @param array $options |
||
207 | */ |
||
208 | protected static function setupCustomDQLFunctions(Configuration $config, array $options) |
||
216 | |||
217 | /** |
||
218 | * Setup Custom DBAL types. |
||
219 | * |
||
220 | * @param \Doctrine\DBAL\Connection $connection |
||
221 | * @param array $options |
||
222 | * |
||
223 | * @throws \Doctrine\DBAL\DBALException |
||
224 | * @throws \RuntimeException |
||
225 | */ |
||
226 | protected static function setupCustomDBALTypes(Connection $connection, array $options) |
||
239 | } |
||
240 |
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.