<?php

namespace App\Form;

use App\Entity\Account;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

class AccountType extends AbstractType
{

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
       $builder
           ->add('username',TextType::class,[
               'label' => 'Utilisateur',
               'required' => true,
           ])
           ->add('email',EmailType::class,[
               'label' => 'Email',
               'required' => true,
           ])
           ->add('firstName',TextType::class,[
               'label' => 'Nom',
               'required' => true,
           ])
           ->add('name',TextType::class,[
               'label' => 'Nom',
               'required' => true,
           ]);
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefault('data_class',Account::class);
    }
}
