<?php

namespace App\Form;

use App\Entity\Etablissement;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class EtablissementType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('numero_uai')
            ->add('secteur')
            ->add('appellation_officielle')
            ->add('adresse')
            ->add('code_postal')
            ->add('commune')
            ->add('latitude')
            ->add('longitude')
            ->add('nature_uai')
            ->add('nature_libe')
            ->add('etat_etablissement_libe')
            ->add('code_departement')
            ->add('code_region')
            ->add('code_academie')
            ->add('code_commune')
            ->add('departement')
            ->add('region')
            ->add('academie')
            ->add('type_contrat')
            ->add('libelle_type_contrat')
            ->add('code_ministere')
            ->add('libelle_ministere')
            ->add('date_ouverture', null, [
                'widget' => 'single_text',
            ])
        ;
    }

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