@@ -162,8 +162,6 @@ protected function configureContainer(ContainerConfigurator $c): void
162162 'url ' => '%env(resolve:DATABASE_URL)% ' ,
163163 ],
164164 'orm ' => [
165- 'auto_generate_proxy_classes ' => true ,
166- 'auto_mapping ' => true ,
167165 'mappings ' => [
168166 'Default ' => [
169167 'is_bundle ' => false ,
@@ -184,18 +182,24 @@ protected function configureContainer(ContainerConfigurator $c): void
184182 ];
185183
186184 if (null !== $ doctrineBundleVersion = InstalledVersions::getVersion ('doctrine/doctrine-bundle ' )) {
187- if (version_compare ($ doctrineBundleVersion , '2.8.0 ' , '>= ' )) {
188- $ doctrineConfig ['orm ' ]['enable_lazy_ghost_objects ' ] = true ;
185+ if (version_compare ($ doctrineBundleVersion , '3.0.0 ' , '< ' )) {
186+ $ doctrineConfig ['orm ' ]['auto_generate_proxy_classes ' ] = true ;
187+ $ doctrineConfig ['orm ' ]['controller_resolver ' ]['auto_mapping ' ] = 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