mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
add ListPerson
Add / complete list of person. Some SQL function are added to allow to get the last address at a given date.
This commit is contained in:
@@ -26,6 +26,7 @@ use Symfony\Component\DependencyInjection\Loader;
|
||||
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||
use Chill\MainBundle\DependencyInjection\MissingBundleException;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Chill\PersonBundle\Doctrine\DQL\AddressPart;
|
||||
|
||||
/**
|
||||
* This is the class that loads and manages your bundle configuration
|
||||
@@ -91,6 +92,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
{
|
||||
$this->prependRoleHierarchy($container);
|
||||
$this->prependHomepageWidget($container);
|
||||
$this->prependDoctrineDQL($container);
|
||||
|
||||
$bundles = $container->getParameter('kernel.bundles');
|
||||
//add ChillMain to assetic-enabled bundles
|
||||
@@ -162,4 +164,33 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add DQL function linked with person
|
||||
*
|
||||
* @param ContainerBuilder $container
|
||||
*/
|
||||
protected function prependDoctrineDQL(ContainerBuilder $container)
|
||||
{
|
||||
//add DQL function to ORM (default entity_manager)
|
||||
|
||||
$container->prependExtensionConfig('doctrine', array(
|
||||
'orm' => array(
|
||||
'dql' => array(
|
||||
'string_functions' => array(
|
||||
'GET_PERSON_ADDRESS_ADDRESS_ID' => AddressPart\AddressPartAddressId::class,
|
||||
'GET_PERSON_ADDRESS_STREET_ADDRESS_1' => AddressPart\AddressPartStreetAddress1::class,
|
||||
'GET_PERSON_ADDRESS_STREET_ADDRESS_2' => AddressPart\AddressPartStreetAddress2::class,
|
||||
'GET_PERSON_ADDRESS_VALID_FROM' => AddressPart\AddressPartValidFrom::class,
|
||||
'GET_PERSON_ADDRESS_POSTCODE_LABEL' => AddressPart\AddressPartPostCodeLabel::class,
|
||||
'GET_PERSON_ADDRESS_POSTCODE_CODE' => AddressPart\AddressPartPostCodeCode::class,
|
||||
'GET_PERSON_ADDRESS_POSTCODE_ID' => AddressPart\AddressPartPostCodeId::class,
|
||||
'GET_PERSON_ADDRESS_COUNTRY_NAME' => AddressPart\AddressPartCountryName::class,
|
||||
'GET_PERSON_ADDRESS_COUNTRY_CODE' => AddressPart\AddressPartCountryCode::class,
|
||||
'GET_PERSON_ADDRESS_COUNTRY_ID' => AddressPart\AddressPartCountryId::class
|
||||
)
|
||||
)
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user