mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
Merge branch 'add-doctrine-dbal-configuration-in-the-bundle' into 'master'
Add Doctrine DBAL postgis configuration in the bundle. See merge request Chill-Projet/chill-bundles!65
This commit is contained in:
commit
73790db700
@ -35,6 +35,8 @@ use Chill\MainBundle\Doctrine\DQL\OverlapsI;
|
|||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
use Symfony\Component\DependencyInjection\Reference;
|
use Symfony\Component\DependencyInjection\Reference;
|
||||||
use Chill\MainBundle\Doctrine\DQL\Replace;
|
use Chill\MainBundle\Doctrine\DQL\Replace;
|
||||||
|
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
|
||||||
|
use Chill\MainBundle\Doctrine\Type\PointType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -167,37 +169,49 @@ 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(
|
[
|
||||||
'unaccent' => Unaccent::class,
|
'orm' => [
|
||||||
'GET_JSON_FIELD_BY_KEY' => GetJsonFieldByKey::class,
|
'dql' => [
|
||||||
'AGGREGATE' => JsonAggregate::class,
|
'string_functions' => [
|
||||||
'REPLACE' => Replace::class,
|
'unaccent' => Unaccent::class,
|
||||||
),
|
'GET_JSON_FIELD_BY_KEY' => GetJsonFieldByKey::class,
|
||||||
'numeric_functions' => [
|
'AGGREGATE' => JsonAggregate::class,
|
||||||
'JSONB_EXISTS_IN_ARRAY' => JsonbExistsInArray::class,
|
'REPLACE' => Replace::class,
|
||||||
'SIMILARITY' => Similarity::class,
|
],
|
||||||
'OVERLAPSI' => OverlapsI::class
|
'numeric_functions' => [
|
||||||
]
|
'JSONB_EXISTS_IN_ARRAY' => JsonbExistsInArray::class,
|
||||||
)
|
'SIMILARITY' => Similarity::class,
|
||||||
)
|
'OVERLAPSI' => OverlapsI::class,
|
||||||
));
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
//add dbal types (default entity_manager)
|
//add dbal types (default entity_manager)
|
||||||
$container->prependExtensionConfig('doctrine', array(
|
$container
|
||||||
'dbal' => [
|
->prependExtensionConfig(
|
||||||
'types' => [
|
'doctrine',
|
||||||
'dateinterval' => [
|
[
|
||||||
'class' => \Chill\MainBundle\Doctrine\Type\NativeDateIntervalType::class
|
'dbal' => [
|
||||||
],
|
// This is mandatory since we are using postgis as database.
|
||||||
'point' => [
|
'mapping_types' => [
|
||||||
'class' => \Chill\MainBundle\Doctrine\Type\PointType::class
|
'geometry' => 'string',
|
||||||
]
|
],
|
||||||
]
|
'types' => [
|
||||||
]
|
'dateinterval' => [
|
||||||
));
|
'class' => NativeDateIntervalType::class
|
||||||
|
],
|
||||||
|
'point' => [
|
||||||
|
'class' => PointType::class
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
//add current route to chill main
|
//add current route to chill main
|
||||||
$container->prependExtensionConfig('chill_main', array(
|
$container->prependExtensionConfig('chill_main', array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user