11
11
12
12
namespace Symfony \UX \LiveComponent \Tests \Fixtures ;
13
13
14
+ use Composer \InstalledVersions ;
14
15
use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
15
16
use Psr \Log \NullLogger ;
16
17
use Symfony \Bundle \FrameworkBundle \FrameworkBundle ;
@@ -125,8 +126,10 @@ protected function configureContainer(ContainerConfigurator $c): void
125
126
'auto_refresh_proxies ' => false ,
126
127
]);
127
128
128
- $ c ->extension ('doctrine ' , [
129
- 'dbal ' => ['url ' => '%env(resolve:DATABASE_URL)% ' ],
129
+ $ doctrineConfig = [
130
+ 'dbal ' => [
131
+ 'url ' => '%env(resolve:DATABASE_URL)% ' ,
132
+ ],
130
133
'orm ' => [
131
134
'auto_generate_proxy_classes ' => true ,
132
135
'auto_mapping ' => true ,
@@ -147,7 +150,20 @@ protected function configureContainer(ContainerConfigurator $c): void
147
150
],
148
151
],
149
152
],
150
- ]);
153
+ ];
154
+ if (null !== $ doctrineBundleVersion = InstalledVersions::getVersion ('doctrine/doctrine-bundle ' )) {
155
+ if (version_compare ($ doctrineBundleVersion , '2.8.0 ' , '>= ' )) {
156
+ $ doctrineConfig ['orm ' ]['enable_lazy_ghost_objects ' ] = true ;
157
+ }
158
+ // https://github.com/doctrine/DoctrineBundle/pull/1661
159
+ if (version_compare ($ doctrineBundleVersion , '2.9.0 ' , '>= ' )) {
160
+ $ doctrineConfig ['orm ' ]['report_fields_where_declared ' ] = true ;
161
+ $ doctrineConfig ['orm ' ]['validate_xml_mapping ' ] = true ;
162
+ $ doctrineConfig ['dbal ' ]['schema_manager_factory ' ] = 'doctrine.dbal.default_schema_manager_factory ' ;
163
+ }
164
+ }
165
+
166
+ $ c ->extension ('doctrine ' , $ doctrineConfig );
151
167
152
168
$ c ->extension ('zenstruck_foundry ' , [
153
169
'auto_refresh_proxies ' => false ,
0 commit comments