| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function onLocalityChanged(FormEvent $event) |
||
| 20 | { |
||
| 21 | $form = $event->getForm(); |
||
| 22 | |||
| 23 | if ($form->getData()) { |
||
| 24 | // Areas of the city |
||
| 25 | $areas = $form->getData()->getAreas(); |
||
| 26 | |||
| 27 | $form->getParent()->add('area', EntityType::class, [ |
||
| 28 | 'class' => 'App\Entity\Area', |
||
| 29 | 'placeholder' => 'placeholder.select_area', |
||
| 30 | 'choice_label' => 'name', |
||
| 31 | 'attr' => [ |
||
| 32 | 'class' => 'form-control', |
||
| 33 | ], |
||
| 34 | 'required' => false, |
||
| 35 | 'label' => 'label.area', |
||
| 36 | 'choices' => $areas, |
||
| 37 | ]); |
||
| 41 |