CommandeLegumesType.php 1.32 KB
Newer Older
1 2 3 4 5 6
<?php

namespace PotageBundle\Form\Membre;

use PotageBundle\Entity\CommandeLegumes;
use Symfony\Component\Form\AbstractType;
7 8
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
9 10 11 12 13 14 15 16
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class CommandeLegumesType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
17 18 19 20 21 22 23 24 25
            /*
                ->add('prixUnitaire', MoneyType::class, array(
                    'currency' => 'EUR',
                    'disabled' => true,
                ))
                ->add('unite', TextType::class, array(
                    'disabled' => true,
                ))
            */
26
            ->add('quantite')
27 28 29
            ->add('prix', MoneyType::class, array(
                'currency' => 'EUR'
            ))
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
        ;
    }
    
    public function configureOptions(OptionsResolver $resolver)
    {
        parent::configureOptions($resolver);
        $resolver->setDefault('data_class', CommandeLegumes::class);
        $resolver->setDefault('attr', array(
            'class' => 'formulaire formulaire_commande',
        ));
    }
    
    public function getBlockPrefix()
    {
        return 'commande_legumes';
    }
}