Move Doctrine DBAL configuration in the appropriate and already existing code section.

This commit is contained in:
Pol Dellaiera 2021-05-25 08:05:18 +02:00
parent bafbc2dd74
commit cb897cfef1

View File

@ -35,6 +35,8 @@ use Chill\MainBundle\Doctrine\DQL\OverlapsI;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Chill\MainBundle\Doctrine\DQL\Replace;
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
use Chill\MainBundle\Doctrine\Type\PointType;
use Symfony\Component\HttpFoundation\Request;
/**
@ -186,28 +188,30 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
],
],
],
// This is mandatory since we are using postgis as database.
'dbal' => [
'mapping_types' => [
'geometry' => 'string',
],
],
],
);
//add dbal types (default entity_manager)
$container->prependExtensionConfig('doctrine', array(
'dbal' => [
'types' => [
'dateinterval' => [
'class' => \Chill\MainBundle\Doctrine\Type\NativeDateIntervalType::class
],
'point' => [
'class' => \Chill\MainBundle\Doctrine\Type\PointType::class
]
]
]
));
$container
->prependExtensionConfig(
'doctrine',
[
'dbal' => [
// This is mandatory since we are using postgis as database.
'mapping_types' => [
'geometry' => 'string',
],
'types' => [
'dateinterval' => [
'class' => NativeDateIntervalType::class
],
'point' => [
'class' => PointType::class
]
]
]
]
);
//add current route to chill main
$container->prependExtensionConfig('chill_main', array(