<?php
namespace App\Form\Order;
use App\Entity\Order\Order;
use App\Form\Order\OrderLineType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\Extension\Core\Type\{CheckboxType,
EmailType,
TextType,
TextareaType,
NumberType,
ChoiceType};
use Symfony\Component\Form\Extension\Core\Type\DateType;
use App\Form\Address\{ShippingAddressType, BillingAddressType, AddressType};
class OrderDevisFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
/*->add('orderLines', CollectionType::class, [
'entry_type' => OrderLineType::class,
])*/
// ->add('state', ChoiceType::class,[
// 'choices' => Order::getStatesChoice(),
// 'label' => 'État'
// ])
// ->add('carrier')
// ->add('paymentMethod')
// ->add('datePayment', DateType::class, [
// 'label' => 'Date de paiement',
// 'widget' => 'single_text',
// 'format' => 'dd/MM/yyyy',
// 'html5' => false,
// 'attr' => ['class' => 'datepicker'],
// 'required' => false
// ])
->add('email', EmailType::class, [
'required'=>false
])
->add('shippingAddress', ShippingAddressType::class)
// ->add('billingAddress', BillingAddressType::class)
// ->add('discount', NumberType::class, [
// 'required' => false,
// 'attr' => ['class' => 'discount']
// ])
// ->add('discountType', ChoiceType::class, [
// 'choices' => \App\Entity\Order\Order::DISCOUNT_TYPE_CHOICES,
// 'required' => false,
// 'attr' => ['class' => 'discountType']
// ])
// ->add('customer', null, ['label' => false, 'attr' => ['class' => 'bootstrap-select']])
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => Order::class,
'label' => ' '
]);
}
}