+ //Add extra pseudonym field
+ if (!empty($options['pseudonym'])) {
+ $form->add('pseudonym', TextType::class, ['attr' => ['placeholder' => 'Your pseudonym'], 'required' => false]);
+ }
+
+ //Add extra subscription field
+ if (!empty($options['subscription'])) {
+ //Add subscription field
+ #$form->add('subscriptions', EntityType::class, ['class' => $options['subscription_class'], 'choice_label' => 'pseudonym', 'preferred_choices' => $options['subscription_favorites'], 'attr' => ['placeholder' => 'Your subscription'], 'choice_translation_domain' => false, 'required' => false, 'data' => $options['subscription_default']]);
+ #$form->add('subscriptions', ChoiceType::class, ['attr' => ['placeholder' => 'Your subscription'], 'choice_attr' => ['class' => 'row'], 'choice_translation_domain' => false, 'choices' => $options['subscription_choices'], 'multiple' => true, 'preferred_choices' => $options['subscription_favorites'], 'required' => false]);
+ $form->add(
+ $form
+ //XXX: by_reference need to be false to allow persisting of data from the read only inverse side
+ ->create('subscriptions', ChoiceType::class, ['attr' => ['placeholder' => 'Your subscription']/*, 'by_reference' => false*/, 'choice_attr' => ['class' => 'row'], 'choice_translation_domain' => false, 'choices' => $options['subscription_choices'], 'multiple' => true, 'preferred_choices' => $options['subscription_favorites'], 'required' => false])
+ ->addModelTransformer(new SubscriptionTransformer($this->manager))
+ #->addModelTransformer(new CollectionToArrayTransformer)
+ );
+ /*, 'expanded' => true*/ /*, 'data' => $options['subscription_default']*/
+ }
+
+ //Add extra zipcode field
+ if (!empty($options['zipcode'])) {
+ $form->add('zipcode', TextType::class, ['attr' => ['placeholder' => 'Your zipcode'], 'required' => false]);