mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
small refactorisations
This commit is contained in:
parent
4c91bf5084
commit
2c53f92a2e
@ -16,6 +16,7 @@ use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@ -45,7 +46,7 @@ final class AgeAggregator implements AggregatorInterface, ExportElementValidated
|
||||
return 'person';
|
||||
}
|
||||
|
||||
public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
$builder->add('date_age_calculation', DateType::class, [
|
||||
'label' => 'Calculate age in relation to this date',
|
||||
|
@ -16,6 +16,7 @@ use Chill\MainBundle\Export\ExportElementValidatedInterface;
|
||||
use Chill\MainBundle\Repository\CountryRepository;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\MainBundle\Util\CountriesInfo;
|
||||
use Doctrine\ORM\Query;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use LogicException;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
@ -122,7 +123,7 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
|
||||
->andWhere($qb->expr()->in('c.countryCode', ':countries'))
|
||||
->setParameter('countries', $values)
|
||||
->getQuery()
|
||||
->getResult(\Doctrine\ORM\Query::HYDRATE_SCALAR);
|
||||
->getResult(Query::HYDRATE_SCALAR);
|
||||
|
||||
// initialize array and add blank key for null values
|
||||
$labels = [
|
||||
|
@ -81,7 +81,11 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface
|
||||
|
||||
public function describeAction($data, $format = 'string')
|
||||
{
|
||||
return ['Filtered by person\'s age'];
|
||||
return ['Filtered by person\'s age: '
|
||||
. 'between %min_age% and %max_age%', [
|
||||
'%min_age%' => $data['min_age'],
|
||||
'%max_age%' => $data['max_age'],
|
||||
], ];
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
|
Loading…
x
Reference in New Issue
Block a user