Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"ext-iconv": "*",
"ext-pdo_sqlite": "*",
"doctrine/dbal": "^4.0",
"doctrine/doctrine-bundle": "^2.11",
"doctrine/doctrine-bundle": "^2.16",
"doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/orm": "^3.0",
"doctrine/orm": "^3.5",
"league/commonmark": "^2.1",
"symfony/apache-pack": "^1.0",
"symfony/asset": "^7",
Expand Down
18 changes: 9 additions & 9 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions config/packages/doctrine.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

return static function (ContainerConfigurator $container): void {
$container->extension('doctrine', [
'orm' => [
'enable_native_lazy_objects' => \PHP_VERSION_ID >= 80400,
],
]);
};
4 changes: 3 additions & 1 deletion config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ doctrine:

profiling_collect_backtrace: '%kernel.debug%'
use_savepoints: true

orm:
auto_generate_proxy_classes: true
enable_lazy_ghost_objects: true
report_fields_where_declared: true
validate_xml_mapping: true
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
identity_generation_preferences:
Doctrine\DBAL\Platforms\PostgreSQLPlatform: identity

auto_mapping: true
mappings:
App:
Expand All @@ -24,6 +25,7 @@ doctrine:
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App

controller_resolver:
auto_mapping: false

Expand Down
32 changes: 32 additions & 0 deletions tests/Doctrine/ORM/ConfigurationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace App\Tests\Doctrine\ORM;

use Doctrine\ORM\Configuration;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;

class ConfigurationTest extends KernelTestCase
{
private function getConfiguration(): Configuration
{
return static::getContainer()->get('doctrine.orm.default_configuration');
}

public function testNativeLazyObjectsSetting(): void
{
if (\PHP_VERSION_ID >= 80400) {
$this->assertTrue($this->getConfiguration()->isNativeLazyObjectsEnabled());
} else {
$this->assertFalse($this->getConfiguration()->isNativeLazyObjectsEnabled());
}
}
}