<?php

namespace Dgcl\ProjectsBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Dgcl\ProjectsBundle\Entity\Utils;

class PieceJointeType extends AbstractType {

 
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options) {
 
            $builder
                    ->add('nom_fichier', 'file', array('attr' => array('class' => 'input-file') ))
                    ->add('question', 'choice', array('required' => true, 'choices' => Utils::getQuestions()))
            ;
 

    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver) {
        $resolver->setDefaults(array(
            'data_class' => 'Dgcl\ProjectsBundle\Entity\PieceJointe'
        ));
    }

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

}
