<?php

namespace Lc\ShopBundle\Form\Frontend;

use FOS\UserBundle\Form\Type\RegistrationFormType as BaseRegistrationFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;

class RegistrationType extends AbstractType
{
        public function getParent()
        {
                return BaseRegistrationFormType::class;
        }

        public function buildForm(FormBuilderInterface $builder, array $options)
        {
                $builder->remove('username')
                        ->add('gender', ChoiceType::class, [
                                'label' => 'field.default.title',
                                'multiple' => false,
                                'expanded' => true,
                                'choices' => [
                                        'field.default.madame' => 1,
                                        'field.default.monsieur' => 0,
                                ],
                                'translation_domain' => 'lcshop',
                        ])
                        ->add('firstName', TextType::class, [
                                'label' => 'field.default.firstname',
                                'translation_domain' => 'lcshop',
                        ])
                        ->add('lastName', TextType::class, [
                                'label' => 'field.default.lastname',
                                'translation_domain' => 'lcshop',
                        ])
                        ->add('phone', TextType::class, [
                                'label' => 'field.default.phone',
                                'translation_domain' => 'lcshop',
                        ])
                        ->add('subscribeNewsletter', CheckboxType::class, [
                                'label' => 'field.default.subscribeNewsletter',
                                'required' => false,
                                'mapped' => false,
                                'translation_domain' => 'lcshop',
                        ]);
        }


}