| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function onLocalitySelected(FormEvent $event) |
||
| 20 | { |
||
| 21 | $form = $event->getForm(); |
||
| 22 | $data = $event->getData(); |
||
| 23 | $areas = $data->getArea(); |
||
| 24 | |||
| 25 | if ($areas) { |
||
| 26 | $form->get('locality')->setData($areas->getLocality()); |
||
| 27 | |||
| 28 | $form->add('area', EntityType::class, [ |
||
| 29 | 'class' => 'App\Entity\Area', |
||
| 30 | 'placeholder' => 'placeholder.select_area', |
||
| 31 | 'choice_label' => 'name', |
||
| 32 | 'attr' => [ |
||
| 33 | 'class' => 'form-control', |
||
| 34 | ], |
||
| 35 | 'required' => false, |
||
| 36 | 'label' => 'label.area', |
||
| 37 | 'choices' => $areas->getLocality()->getAreas(), |
||
| 38 | ]); |
||
| 42 |