add validation to aggregator and filters

This commit is contained in:
2017-03-07 16:03:49 +01:00
parent cc91ade6fe
commit 559239aca1
7 changed files with 55 additions and 6 deletions

View File

@@ -22,6 +22,9 @@ namespace Chill\PersonBundle\Export\Aggregator;
use Chill\MainBundle\Export\AggregatorInterface;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Translation\TranslatorInterface;
/**
*
@@ -30,6 +33,17 @@ use Symfony\Component\Form\Extension\Core\Type\DateType;
*/
class AgeAggregator implements AggregatorInterface
{
/**
*
* @var
*/
protected $translator;
public function __construct($translator)
{
$this->translator = $translator;
}
public function addRole()
{
@@ -67,7 +81,7 @@ class AgeAggregator implements AggregatorInterface
}
if ($value === NULL) {
return "no data";
return $this->translator->trans("without data");
}
return $value;