<?php

namespace App\Form;

use App\Entity\Event;
use App\Entity\Space;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class SpaceType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('name', null, [
                'label' => 'Nom de l\'espace',
                'required' => true,
                'help' => 'Entrez un nom pour cet espace.',
                'label_attr' => ['class' => 'label'],
                'attr' => ['class' => 'input', 'autofocus' => true],
                'row_attr' => ['class' => 'field'],
                'help_attr' => ['class' => 'help'],
            ])
        ;
    }

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