@@ -162,7 +162,6 @@ protected function configureContainer(ContainerConfigurator $c): void
162162 'url ' => '%env(resolve:DATABASE_URL)% ' ,
163163 ],
164164 'orm ' => [
165- 'auto_generate_proxy_classes ' => true ,
166165 'auto_mapping ' => true ,
167166 'mappings ' => [
168167 'Default ' => [
@@ -184,18 +183,23 @@ protected function configureContainer(ContainerConfigurator $c): void
184183 ];
185184
186185 if (null !== $ doctrineBundleVersion = InstalledVersions::getVersion ('doctrine/doctrine-bundle ' )) {
187- if (version_compare ($ doctrineBundleVersion , '2.8.0 ' , '>= ' )) {
188- $ doctrineConfig ['orm ' ]['enable_lazy_ghost_objects ' ] = true ;
186+ if (version_compare ($ doctrineBundleVersion , '3.0.0 ' , '< ' )) {
187+ $ doctrineConfig ['orm ' ]['auto_generate_proxy_classes ' ] = true ;
188+
189+ if (version_compare ($ doctrineBundleVersion , '2.8.0 ' , '>= ' )) {
190+ $ doctrineConfig ['orm ' ]['enable_lazy_ghost_objects ' ] = true ;
191+ }
192+ if (version_compare ($ doctrineBundleVersion , '2.12.0 ' , '>= ' )) {
193+ $ doctrineConfig ['orm ' ]['controller_resolver ' ]['auto_mapping ' ] = false ;
194+ }
189195 }
196+
190197 // https://github.com/doctrine/DoctrineBundle/pull/1661
191198 if (version_compare ($ doctrineBundleVersion , '2.9.0 ' , '>= ' )) {
192199 $ doctrineConfig ['orm ' ]['report_fields_where_declared ' ] = true ;
193200 $ doctrineConfig ['orm ' ]['validate_xml_mapping ' ] = true ;
194201 $ doctrineConfig ['dbal ' ]['schema_manager_factory ' ] = 'doctrine.dbal.default_schema_manager_factory ' ;
195202 }
196- if (version_compare ($ doctrineBundleVersion , '2.12.0 ' , '>= ' )) {
197- $ doctrineConfig ['orm ' ]['controller_resolver ' ]['auto_mapping ' ] = false ;
198- }
199203 if (\PHP_VERSION_ID >= 80400 && version_compare ($ doctrineBundleVersion , '2.15.0 ' , '>= ' )) {
200204 $ doctrineConfig ['orm ' ]['enable_native_lazy_objects ' ] = true ;
201205 }
0 commit comments