Conditions | 4 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | public function buildForm(FormBuilderInterface $builder, array $options): void |
||
25 | { |
||
26 | foreach ($options['facets'] as $facetId => $facetData) { |
||
27 | $facet = $this->facetRegistry->getFacetById($facetId); |
||
28 | $choices = []; |
||
29 | foreach ($facetData['buckets'] as $bucket) { |
||
30 | $choices[$facet->getBucketLabel($bucket)] = $bucket['key']; |
||
31 | } |
||
32 | if (!empty($choices)) { |
||
33 | $builder |
||
34 | ->add( |
||
35 | $facetId, |
||
36 | ChoiceType::class, |
||
37 | [ |
||
38 | 'label' => $facet->getLabel(), |
||
39 | 'choices' => $choices, |
||
40 | 'expanded' => true, |
||
41 | 'multiple' => true, |
||
42 | ] |
||
55 |