+use Symfony\Component\OptionsResolver\OptionsResolver;
+
+use Rapsys\AirBundle\Entity\Country;
+
+use Rapsys\UserBundle\Form\RegisterType as BaseRegisterType;
+
+class RegisterType extends BaseRegisterType {
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options): FormBuilderInterface {
+ //Call parent build form
+ $form = parent::buildForm($builder, $options);
+
+ //Add extra city field
+ if (!empty($options['city'])) {
+ $form->add('city', TextType::class, ['attr' => ['placeholder' => 'Your city'], 'required' => false]);
+ }
+
+ //Add extra country field
+ if (!empty($options['country'])) {
+ //Add country field
+ $form->add('country', EntityType::class, ['class' => $options['country_class'], 'choice_label' => 'title'/*, 'choices' => $options['location_choices']*/, 'preferred_choices' => $options['country_favorites'], 'attr' => ['placeholder' => 'Your country'], 'choice_translation_domain' => false, 'required' => true, 'data' => $options['country_default']]);
+ }
+
+ //Add extra phone field
+ if (!empty($options['phone'])) {
+ $form->add('phone', TelType::class, ['attr' => ['placeholder' => 'Your phone'], 'required' => false]);
+ }
+
+ //Add extra pseudonym field
+ if (!empty($options['pseudonym'])) {
+ $form->add('pseudonym', TextType::class, ['attr' => ['placeholder' => 'Your pseudonym'], 'required' => false]);
+ }
+
+ //Add extra zipcode field
+ if (!empty($options['zipcode'])) {
+ $form->add('zipcode', TextType::class, ['attr' => ['placeholder' => 'Your zipcode'], 'required' => false]);
+ }
+
+ //Return form
+ return $form;
+ }