Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function onCityChanged(FormEvent $event): void |
||
23 | { |
||
24 | $form = $event->getForm(); |
||
25 | |||
26 | if ($form->getData()) { |
||
27 | // Metro stations |
||
28 | $stations = $form->getData()->getMetroStations(); |
||
29 | |||
30 | $form->getParent()->add('metro_station', EntityType::class, [ |
||
31 | 'class' => 'App\Entity\Metro', |
||
32 | 'placeholder' => 'placeholder.select_metro_station', |
||
33 | 'choice_label' => 'name', |
||
34 | 'attr' => [ |
||
35 | 'class' => 'form-control', |
||
36 | ], |
||
37 | 'required' => false, |
||
38 | 'label' => 'label.metro_station_name', |
||
39 | 'choices' => $stations, |
||
40 | ]); |
||
44 |