Add Doctrine DBAL postgis configuration in the bundle.

This can now be removed totally from the user application.
This commit is contained in:
Pol Dellaiera 2021-05-25 07:57:12 +02:00
parent 220f1ea0eb
commit bafbc2dd74

View File

@ -167,23 +167,33 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
$container->prependExtensionConfig('twig', $twigConfig); $container->prependExtensionConfig('twig', $twigConfig);
//add DQL function to ORM (default entity_manager) //add DQL function to ORM (default entity_manager)
$container->prependExtensionConfig('doctrine', array( $container
'orm' => array( ->prependExtensionConfig(
'dql' => array( 'doctrine',
'string_functions' => array( [
'orm' => [
'dql' => [
'string_functions' => [
'unaccent' => Unaccent::class, 'unaccent' => Unaccent::class,
'GET_JSON_FIELD_BY_KEY' => GetJsonFieldByKey::class, 'GET_JSON_FIELD_BY_KEY' => GetJsonFieldByKey::class,
'AGGREGATE' => JsonAggregate::class, 'AGGREGATE' => JsonAggregate::class,
'REPLACE' => Replace::class, 'REPLACE' => Replace::class,
), ],
'numeric_functions' => [ 'numeric_functions' => [
'JSONB_EXISTS_IN_ARRAY' => JsonbExistsInArray::class, 'JSONB_EXISTS_IN_ARRAY' => JsonbExistsInArray::class,
'SIMILARITY' => Similarity::class, 'SIMILARITY' => Similarity::class,
'OVERLAPSI' => OverlapsI::class 'OVERLAPSI' => OverlapsI::class,
] ],
) ],
) ],
)); // This is mandatory since we are using postgis as database.
'dbal' => [
'mapping_types' => [
'geometry' => 'string',
],
],
],
);
//add dbal types (default entity_manager) //add dbal types (default entity_manager)
$container->prependExtensionConfig('doctrine', array( $container->prependExtensionConfig('doctrine', array(