|
13 | 13 |
|
14 | 14 | use Composer\InstalledVersions; |
15 | 15 | use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; |
16 | | -use Doctrine\ORM\Mapping\AssociationMapping; |
17 | 16 | use Psr\Log\NullLogger; |
18 | 17 | use Symfony\Bundle\FrameworkBundle\FrameworkBundle; |
19 | 18 | use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; |
@@ -81,7 +80,7 @@ public function registerBundles(): iterable |
81 | 80 | protected function build(ContainerBuilder $container): void |
82 | 81 | { |
83 | 82 | // workaround https://github.com/symfony/symfony/issues/50322 |
84 | | - $container->addCompilerPass(new class() implements CompilerPassInterface { |
| 83 | + $container->addCompilerPass(new class implements CompilerPassInterface { |
85 | 84 | public function process(ContainerBuilder $container): void |
86 | 85 | { |
87 | 86 | $container->removeDefinition('doctrine.orm.listeners.pdo_session_handler_schema_listener'); |
@@ -190,18 +189,29 @@ protected function configureContainer(ContainerConfigurator $c): void |
190 | 189 | if (version_compare($doctrineBundleVersion, '2.8.0', '>=')) { |
191 | 190 | $doctrineConfig['orm']['enable_lazy_ghost_objects'] = true; |
192 | 191 | } |
| 192 | + |
| 193 | + // https://github.com/doctrine/DoctrineBundle/pull/1661 |
| 194 | + if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) { |
| 195 | + $doctrineConfig['orm']['report_fields_where_declared'] = true; |
| 196 | + } |
| 197 | + |
193 | 198 | if (version_compare($doctrineBundleVersion, '2.12.0', '>=')) { |
194 | 199 | $doctrineConfig['orm']['controller_resolver']['auto_mapping'] = false; |
195 | 200 | } |
196 | 201 | } |
197 | 202 |
|
198 | 203 | // https://github.com/doctrine/DoctrineBundle/pull/1661 |
199 | 204 | if (version_compare($doctrineBundleVersion, '2.9.0', '>=')) { |
200 | | - $doctrineConfig['orm']['report_fields_where_declared'] = true; |
201 | 205 | $doctrineConfig['orm']['validate_xml_mapping'] = true; |
202 | 206 | $doctrineConfig['dbal']['schema_manager_factory'] = 'doctrine.dbal.default_schema_manager_factory'; |
| 207 | + |
| 208 | + // https://github.com/doctrine/DoctrineBundle/pull/1962 |
| 209 | + if (version_compare($doctrineBundleVersion, '3.0.0', '<')) { |
| 210 | + $doctrineConfig['orm']['report_fields_where_declared'] = true; |
| 211 | + } |
203 | 212 | } |
204 | | - if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=')) { |
| 213 | + |
| 214 | + if (\PHP_VERSION_ID >= 80400 && version_compare($doctrineBundleVersion, '2.15.0', '>=') && version_compare($doctrineBundleVersion, '4.0.0', '<')) { |
205 | 215 | $doctrineConfig['orm']['enable_native_lazy_objects'] = true; |
206 | 216 | } |
207 | 217 | } |
|
0 commit comments