File tree Expand file tree Collapse file tree 5 files changed +57
-12
lines changed Expand file tree Collapse file tree 5 files changed +57
-12
lines changed Original file line number Diff line number Diff line change 1111 "ext-iconv" : " *" ,
1212 "ext-pdo_sqlite" : " *" ,
1313 "doctrine/dbal" : " ^4.0" ,
14- "doctrine/doctrine-bundle" : " ^2.11 " ,
14+ "doctrine/doctrine-bundle" : " ^2.16 " ,
1515 "doctrine/doctrine-migrations-bundle" : " ^3.3" ,
16- "doctrine/orm" : " ^3.0 " ,
16+ "doctrine/orm" : " ^3.5 " ,
1717 "league/commonmark" : " ^2.1" ,
1818 "symfony/apache-pack" : " ^1.0" ,
1919 "symfony/asset" : " ^7" ,
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Symfony \Component \DependencyInjection \Loader \Configurator ;
4+
5+ return static function (ContainerConfigurator $ container ): void {
6+ $ container ->extension ('doctrine ' , [
7+ 'orm ' => [
8+ 'enable_native_lazy_objects ' => \PHP_VERSION_ID >= 80400 ,
9+ ],
10+ ]);
11+ };
Original file line number Diff line number Diff line change @@ -8,14 +8,15 @@ doctrine:
88
99 profiling_collect_backtrace : ' %kernel.debug%'
1010 use_savepoints : true
11+
1112 orm :
1213 auto_generate_proxy_classes : true
13- enable_lazy_ghost_objects : true
1414 report_fields_where_declared : true
1515 validate_xml_mapping : true
1616 naming_strategy : doctrine.orm.naming_strategy.underscore_number_aware
1717 identity_generation_preferences :
1818 Doctrine\DBAL\Platforms\PostgreSQLPlatform : identity
19+
1920 auto_mapping : true
2021 mappings :
2122 App :
@@ -24,6 +25,7 @@ doctrine:
2425 dir : ' %kernel.project_dir%/src/Entity'
2526 prefix : ' App\Entity'
2627 alias : App
28+
2729 controller_resolver :
2830 auto_mapping : false
2931
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /*
4+ * This file is part of the Symfony package.
5+ *
6+ * (c) Fabien Potencier <fabien@symfony.com>
7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
12+ namespace App \Tests \Doctrine \ORM ;
13+
14+ use Doctrine \ORM \Configuration ;
15+ use Symfony \Bundle \FrameworkBundle \Test \KernelTestCase ;
16+
17+ class ConfigurationTest extends KernelTestCase
18+ {
19+ private function getConfiguration (): Configuration
20+ {
21+ return static ::getContainer ()->get ('doctrine.orm.default_configuration ' );
22+ }
23+
24+ public function testNativeLazyObjectsSetting (): void
25+ {
26+ if (\PHP_VERSION_ID >= 80400 ) {
27+ $ this ->assertTrue ($ this ->getConfiguration ()->isNativeLazyObjectsEnabled ());
28+ } else {
29+ $ this ->assertFalse ($ this ->getConfiguration ()->isNativeLazyObjectsEnabled ());
30+ }
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments