File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Autocomplete/tests/Fixtures
LiveComponent/tests/Fixtures Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1111
1212namespace Symfony \UX \Autocomplete \Tests \Fixtures ;
1313
14+ use Composer \InstalledVersions ;
1415use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
1516use Doctrine \ORM \Mapping \AssociationMapping ;
1617use Fixtures \Form \CategoryWithCallbackAsCustomValue ;
@@ -104,7 +105,7 @@ protected function configureContainer(ContainerConfigurator $c): void
104105 'auto_refresh_proxies ' => false ,
105106 ]);
106107
107- $ config = [
108+ $ doctrineConfig = [
108109 'dbal ' => ['url ' => '%env(resolve:DATABASE_URL)% ' ],
109110 'orm ' => [
110111 'auto_generate_proxy_classes ' => true ,
@@ -122,11 +123,17 @@ protected function configureContainer(ContainerConfigurator $c): void
122123 ];
123124 if (class_exists (AssociationMapping::class)) {
124125 // Doctrine ORM >= 3.0
125- $ config ['orm ' ]['controller_resolver ' ] = [
126+ $ doctrineConfig ['orm ' ]['controller_resolver ' ] = [
126127 'auto_mapping ' => true ,
127128 ];
128129 }
129- $ c ->extension ('doctrine ' , $ config );
130+ if (null !== $ doctrineBundleVersion = InstalledVersions::getVersion ('doctrine/doctrine-bundle ' )) {
131+ if (\PHP_VERSION_ID >= 80400 && version_compare ($ doctrineBundleVersion , '2.15.0 ' , '>= ' )) {
132+ $ doctrineConfig ['orm ' ]['enable_native_lazy_objects ' ] = true ;
133+ }
134+ }
135+
136+ $ c ->extension ('doctrine ' , $ doctrineConfig );
130137
131138 $ c ->extension ('security ' , [
132139 'password_hashers ' => [
Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ protected function configureContainer(ContainerConfigurator $c): void
186186 if (version_compare ($ doctrineBundleVersion , '2.12.0 ' , '>= ' )) {
187187 $ doctrineConfig ['orm ' ]['controller_resolver ' ]['auto_mapping ' ] = false ;
188188 }
189+ if (\PHP_VERSION_ID >= 80400 && version_compare ($ doctrineBundleVersion , '2.15.0 ' , '>= ' )) {
190+ $ doctrineConfig ['orm ' ]['enable_native_lazy_objects ' ] = true ;
191+ }
189192 }
190193
191194 $ c ->extension ('doctrine ' , $ doctrineConfig );
You can’t perform that action at this time.
0 commit comments