collection-crud/config/packages/doctrine.php

35 lines
943 B
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],
'mapping_types' => ['bit' => 'boolean', 'money' => 'money'],
'url' => '%env(DATABASE_URL)%'
],
'orm' => [
'auto_generate_proxy_classes' => '%kernel.debug%',
'naming_strategy' => 'doctrine.orm.naming_strategy.underscore_number_aware',
'auto_mapping' => TRUE,
'mappings' => [
'App' => [
'is_bundle' => FALSE,
'type' => 'attribute',
'dir' => '%kernel.project_dir%/src/Entity',
'prefix' => 'App\Entity',
'alias' => 'App']
]
]
]);
};