<?php

namespace App\Form;

use App\Entity\Clients;
use App\Entity\Commandes;
use App\Entity\Tables;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class ClientsType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('Prenom')
            ->add('Nom')
            ->add('Email')
            ->add('Telephone')
            ->add('Tables', EntityType::class, [
                'class' => Tables::class,
                'choice_label' => 'id',
                'multiple' => true,
            ])
            ->add('Commandes', EntityType::class, [
                'class' => Commandes::class,
                'choice_label' => 'id',
                'multiple' => true,
            ])
        ;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => Clients::class,
        ]);
    }
}
