<?php

namespace OfficeBrain\Bundle\CmsBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormTypeInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Validator\ExecutionContextInterface as context;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormError;
use Symfony\Component\Validator\Constraints as Assert;
use Doctrine\ORM\EntityRepository;

class ContactUsType extends AbstractType
{
	
	/**
	 *
	 * @param ContainerInterface $container
	 * @param $mode
	 */
	public function __construct(ContainerInterface $container)
	{
		$this->container = $container;
		//$this->side = $side;
		$this->request = $this->container->get('request');
		$this->projectSetting = $this->request->get('project_user_setting')['user_data'];
		//$this->userId = $this->projectSetting->getId();
	}
	
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('fullName')
            ->add('companyName')
            ->add('phone')
            ->add('website')
            ->add('email')
            ->add('city')
            ->add('message')            
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'OfficeBrain\Bundle\CmsBundle\Entity\ContactUs'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'officebrain_bundle_cmsbundle_contactus';
    }
}
