<?php

namespace HVCSiteBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class LignefraishorsfraisType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder

            ->add('date')


            ->add('montant','integer', array(
                'label'=>'Montant',
                'attr'=>array(
                    'placeholder'=>'Saisir le montant',
                    'class'=>'formdate'
                )
            ))
            //recherche bdd
            //->add('libelle', 'entity', array('class' => 'HVCSiteBundle\Entity\Lignefraishorsfrais','property' => 'libelle','read_only' => true,))


            ->add('libelle', 'text', array(
                'label'=>'Libelle',
                'attr'=>array(
                    'placeholder'=>'Saisir le libelle',
                    'class'=>'formdate'
                )


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

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