remove unused param in aggregators type + fix bug with labels

This commit is contained in:
Julien Fastré 2016-01-26 11:33:43 +01:00
parent 630be1d3d2
commit b7f92a71cf
2 changed files with 2 additions and 8 deletions

View File

@ -69,10 +69,6 @@ class AggregatorType extends AbstractType
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setRequired('aggregator_alias')
->setRequired('aggregators_length')
->setAllowedTypes(array(
'aggregators_length' => 'int'
))
->setDefault('compound', true)
;
}

View File

@ -73,16 +73,14 @@ class ExportType extends AbstractType
$builder->add($filterBuilder);
//add aggregators
$aggregators = iterator_to_array($this->exportManager
->getAggregatorsApplyingOn($export->supportsModifiers()));
$aggregators = $this->exportManager
->getAggregatorsApplyingOn($export->supportsModifiers());
$aggregatorBuilder = $builder->create('aggregators', 'form',
array('compound' => true));
$nb = count($aggregators);
foreach($aggregators as $alias => $aggregator) {
$aggregatorBuilder->add($alias, new AggregatorType($this->exportManager), array(
'aggregator_alias' => $alias,
'aggregators_length' => $nb,
'label' => $aggregator->getTitle()
));
}