<?php

namespace App\Form;

use App\Entity\EventMedia;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Vich\UploaderBundle\Form\Type\VichImageType;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class EventMediaType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('imgMediaFile', VichImageType::class, [
                'data_class' => null, 
                'allow_delete' => false,
                'download_uri' => false,
                'translation_domain' => 'admin',
                'required' => false
            ])
            ->add('videoMedia', TextType::class, ['required' => false, 'translation_domain' => 'admin'])
            ;
    }

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