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 11
11
12
12
namespace Symfony \UX \Autocomplete \Tests \Fixtures ;
13
13
14
+ use Composer \InstalledVersions ;
14
15
use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
15
16
use Doctrine \ORM \Mapping \AssociationMapping ;
16
17
use Fixtures \Form \CategoryWithCallbackAsCustomValue ;
@@ -104,7 +105,7 @@ protected function configureContainer(ContainerConfigurator $c): void
104
105
'auto_refresh_proxies ' => false ,
105
106
]);
106
107
107
- $ config = [
108
+ $ doctrineConfig = [
108
109
'dbal ' => ['url ' => '%env(resolve:DATABASE_URL)% ' ],
109
110
'orm ' => [
110
111
'auto_generate_proxy_classes ' => true ,
@@ -122,11 +123,17 @@ protected function configureContainer(ContainerConfigurator $c): void
122
123
];
123
124
if (class_exists (AssociationMapping::class)) {
124
125
// Doctrine ORM >= 3.0
125
- $ config ['orm ' ]['controller_resolver ' ] = [
126
+ $ doctrineConfig ['orm ' ]['controller_resolver ' ] = [
126
127
'auto_mapping ' => true ,
127
128
];
128
129
}
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 );
130
137
131
138
$ c ->extension ('security ' , [
132
139
'password_hashers ' => [
Original file line number Diff line number Diff line change @@ -186,6 +186,9 @@ protected function configureContainer(ContainerConfigurator $c): void
186
186
if (version_compare ($ doctrineBundleVersion , '2.12.0 ' , '>= ' )) {
187
187
$ doctrineConfig ['orm ' ]['controller_resolver ' ]['auto_mapping ' ] = false ;
188
188
}
189
+ if (\PHP_VERSION_ID >= 80400 && version_compare ($ doctrineBundleVersion , '2.15.0 ' , '>= ' )) {
190
+ $ doctrineConfig ['orm ' ]['enable_native_lazy_objects ' ] = true ;
191
+ }
189
192
}
190
193
191
194
$ c ->extension ('doctrine ' , $ doctrineConfig );
You can’t perform that action at this time.
0 commit comments