<?php
namespace App\Form;
use App\Entity\CodeNaf;
use App\Entity\Coordinates;
use App\Entity\Departement;
use App\Entity\FilesUser;
use App\Entity\Workforce;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class FilesUserType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('state', ChoiceType::class, [
'choices' => [
'Fermé' => 'Fermé',
'Actif' => 'Actif',
'Actif et Fermé' => 'Actif et Fermé',
],
])
->add('coordinates', EntityType::class, [
'class' => Coordinates::class,
'expanded' => false,
'multiple' => true,
'required' => false,
])
->add('codeNaf', EntityType::class, [
'class' => CodeNaf::class,
'expanded' => false,
'multiple' => true,
'required' => false,
])
->add('departement', EntityType::class, [
'class' => Departement::class,
'expanded' => false,
'multiple' => true,
'required' => false,
])
->add('workforce', EntityType::class, [
'class' => Workforce::class,
'expanded' => false,
'multiple' => true,
'required' => false,
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => FilesUser::class,
]);
}
}