<?php
namespace App\Form;
use App\Form\Custom\CustomTextType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\CountryType;
use Symfony\Component\OptionsResolver\OptionsResolver;
class AgencyRegistrationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('userName', CustomTextType::class, array('mapped' => false))
->add('userSurname', CustomTextType::class, array('mapped' => false))
->add('userEmail', CustomTextType::class, array('mapped' => false))
->add('name', CustomTextType::class)
->add('fiscalCode', CustomTextType::class)
->add('vat', CustomTextType::class)
->add('vatCountry', CountryType::class, array('placeholder' => ''))
->add('sdi', CustomTextType::class)
->add('email', CustomTextType::class)
->add('phone', CustomTextType::class)
->add('iban', CustomTextType::class)
->add('swift', CustomTextType::class)
->add('street', CustomTextType::class, array('mapped' => false))
->add('number', CustomTextType::class, array('mapped' => false))
->add('internal', CustomTextType::class, array('mapped' => false))
->add('stairs', CustomTextType::class, array('mapped' => false))
->add('floor', CustomTextType::class, array('mapped' => false))
->add('zip', CustomTextType::class, array('mapped' => false))
->add('city', CustomTextType::class, array('mapped' => false))
->add('province', CustomTextType::class, array('mapped' => false))
->add('recaptcha', HiddenType::class, array("mapped" => false));
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'App\Entity\Agency',
'validation_groups' => array('agency_registration')
));
}
}