<?php
namespace AppBundle\Form\Customer;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Length;
use Symfony\Component\Validator\Constraints\NotBlank;
class AgentContactFormType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', null, [
'label' => false,
'attr' => ['class'=> 'form-control input-sm', 'placeholder' => 'ImiÄ™ i nazwisko / nazwa firmy', 'required' => true],
'translation_domain' => false,
'constraints' => [
new NotBlank(),
new Length(['min' => 3]),
]
])
->add('address', null, [
'label' => false,
'attr' => ['class'=> 'form-control input-sm', 'placeholder' => 'Adres', 'required' => true],
'translation_domain' => false,
'constraints' => [
new NotBlank(),
new Length(['min' => 3]),
]
])
->add('regon', null, [
'label' => false,
'attr' => ['class'=> 'form-control input-sm', 'placeholder' => 'Regon', 'required' => false],
'translation_domain' => false
])
->add('phone', null, [
'label' => false,
'attr' => ['class'=> 'form-control input-sm', 'placeholder' => 'Numer telefonu', 'required' => true],
'translation_domain' => false,
'constraints' => [
new NotBlank(),
new Length(['min' => 9]),
]
])
->add('email', EmailType::class, [
'label' => false,
'attr' => ['class'=> 'form-control input-sm', 'placeholder' => 'E-mail', 'required' => true],
'translation_domain' => false,
'constraints' => [
new NotBlank(),
new Length(['min' => 3]),
]
])
->add('www', null, [
'label' => false,
'attr' => ['class'=> 'form-control input-sm', 'placeholder' => 'WWW', 'required' => false],
'translation_domain' => false
])
->add('rodo', null, [
'label' => false,
'attr' => ['class'=> 'form-check-input', 'required' => true],
'translation_domain' => false,
'constraints' => [
new NotBlank()
]
])
->add('experience', null, [
'label' => false,
'attr' => ['class'=> 'ml-4', 'required' => false],
'translation_domain' => false
])
->add('ownLocal', null, [
'label' => false,
'attr' => ['class'=> 'ml-4', 'required' => false],
'translation_domain' => false
])
->add('businessActivity', null, [
'label' => false,
'attr' => ['class'=> 'ml-4', 'required' => false],
'translation_domain' => false
])
;
}/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => 'AppBundle\Entity\Customer\AgentContactForm'
));
}
/**
* {@inheritdoc}
*/
public function getBlockPrefix()
{
return 'appbundle_customer_agentcontactform';
}
}