collection-crud/config/packages/doctrine.php

39 lines
1.1 KiB
PHP
Raw Normal View History

2022-11-03 10:44:05 -04:00
<?php
declare(strict_types=1);
use App\Types\MoneyType;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set('env(DATABASE_URL)', '');
$containerConfigurator->extension('doctrine', [
'dbal' => [
'driver' => 'pdo_pgsql',
'types' => ['money' => MoneyType::class],
2022-11-17 15:32:57 -05:00
'logging' => '%kernel.debug%',
2022-11-03 10:44:05 -04:00
'mapping_types' => ['bit' => 'boolean', 'money' => 'money'],
2023-07-21 10:35:15 -04:00
'url' => '%env(DATABASE_URL)%',
2022-11-03 10:44:05 -04:00
],
'orm' => [
'auto_generate_proxy_classes' => '%kernel.debug%',
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
'auto_mapping' => TRUE,
'enable_lazy_ghost_objects' => TRUE,
2022-11-03 10:44:05 -04:00
'mappings' => [
'App' => [
'is_bundle' => FALSE,
'type' => 'attribute',
'dir' => '%kernel.project_dir%/src/Entity',
'prefix' => 'App\Entity',
2023-07-21 10:35:15 -04:00
'alias' => 'App'],
],
'controller_resolver' => [
'auto_mapping' => true,
]
2023-07-21 10:35:15 -04:00
],
2022-11-03 10:44:05 -04:00
]);
};