88use  Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
99use  Doctrine \ORM \Configuration ;
1010use  Doctrine \ORM \Mapping \LegacyReflectionFields ;
11+ use  Doctrine \Bundle \DoctrineBundle \Dbal \BlacklistSchemaAssetFilter ;
1112use  Meilisearch \Bundle \MeilisearchBundle ;
1213use  Symfony \Bridge \Doctrine \ArgumentResolver \EntityValueResolver ;
1314use  Symfony \Bundle \FrameworkBundle \FrameworkBundle ;
@@ -29,18 +30,30 @@ public function registerBundles(): iterable
2930
3031    protected  function  configureContainer (ContainerBuilder $ containerLoaderInterface $ loadervoid 
3132    {
33+         $ loaderload (__DIR__ .'/config/framework.yaml ' );
34+ 
35+         $ doctrineBundleV3class_exists (BlacklistSchemaAssetFilter::class);
36+ 
3237        if  (PHP_VERSION_ID  >= 80000 ) {
33-             if  (class_exists (LegacyReflectionFields::class) &&  PHP_VERSION_ID  >=  80400 ) {
38+             if  ($ doctrineBundleV3 
3439                $ loaderload (__DIR__ .'/config/config.yaml ' );
40+             } elseif  (class_exists (LegacyReflectionFields::class) && PHP_VERSION_ID  >= 80400 ) {
41+                 $ loaderload (__DIR__ .'/config/config_doctrine_v2.yaml ' );
3542            } else  {
3643                $ loaderload (__DIR__ .'/config/config_old_proxy.yaml ' );
3744            }
3845        } else  {
39-             $ loaderload (__DIR__ .'/config/config_php7.yaml ' );
46+             $ containerprependExtensionConfig ('framework ' , [
47+                 'annotations '  => true ,
48+                 'serializer '  => ['enable_annotations '  => true ],
49+                 'router '  => ['utf8 '  => true ],
50+             ]);
51+ 
52+             $ loaderload (__DIR__ .'/config/doctrine_php7.yaml ' );
4053        }
4154        $ loaderload (__DIR__ .'/config/meilisearch.yaml ' );
4255
43-         if  (\defined (ConnectionFactory::class.'::DEFAULT_SCHEME_MAP ' )) {
56+         if  (\defined (ConnectionFactory::class.'::DEFAULT_SCHEME_MAP ' ) && ! $ doctrineBundleV3 
4457            $ containerprependExtensionConfig ('doctrine ' , [
4558                'orm '  => [
4659                    'report_fields_where_declared '  => true ,
@@ -49,14 +62,21 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
4962            ]);
5063        }
5164
52-         // @phpstan-ignore-next-line 
53-         if  (method_exists (Configuration::class, 'setLazyGhostObjectEnabled ' ) && Kernel::VERSION_ID  >= 60100 ) {
54-             $ containerprependExtensionConfig ('doctrine ' , [
55-                 'orm '  => [
56-                     'enable_lazy_ghost_objects '  => true ,
57-                 ],
58-             ]);
59-         }
65+ 
66+ 
67+ //        if (!class_exists(BlacklistSchemaAssetFilter::class)) { 
68+ //            $container->prependExtensionConfig('doctrine', [ 
69+ //                'orm' => [ 
70+ //                    'enable_native_lazy_objects' => true, 
71+ //                ], 
72+ //            ]); 
73+ //        } elseif (method_exists(Configuration::class, 'setLazyGhostObjectEnabled') && Kernel::VERSION_ID >= 60100 && !$doctrineBundleV3) { 
74+ //            $container->prependExtensionConfig('doctrine', [ 
75+ //                'orm' => [ 
76+ //                    'enable_lazy_ghost_objects' => true, 
77+ //                ], 
78+ //            ]); 
79+ //        } 
6080
6181        if  (class_exists (EntityValueResolver::class)) {
6282            $ containerprependExtensionConfig ('doctrine ' , [
0 commit comments