<?php
namespace App\Form\Backend;
use App\Entity\Entreprise;
use App\Entity\FirmLinkReason;
use App\Form\Backend\AutocompleteField\FirmField;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class FirmFusionType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('toFirm', FirmField::class, [
'required' => true,
'label' => 'Entreprise vers laquelle on fusionne',
])
->add('date', DateType::class, [
'required' => true,
'label' => 'Date de fusion',
'html5' => true,
'widget' => 'single_text'
])
->add('type', EntityType::class, [
'required' => true,
'label' => 'Motif',
'class' => FirmLinkReason::class,
'choice_label' => 'name'
])
->add('comment', TextareaType::class, [
'required' => false,
'label' => 'Commentaire'
])
;
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}