<?php

namespace AutoAdmin\Bundle\Media\Form\Type\Media;

use AutoAdmin\Bundle\Admin\Form\Type\Component\CollectionType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * #[ORM\Column(type: Types::JSON)]
 * #[LinkedMedia(mappings: ['image','file'])]
 * protected ?array $linkedMediaCollection = [];
 */
class LinkedMediaCollectionType extends AbstractType
{
    public function configureOptions(OptionsResolver $resolver): void
    {
        parent::configureOptions($resolver);

        $resolver->setDefaults([
            'entry_type'=> LinkedMediaType::class,
            'entry_options'=> [],
        ]);
    }

    public function getParent(): string
    {
        return CollectionType::class;
    }

    public function getBlockPrefix(): string
    {
        return 'aa_media_collection';
    }

    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        parent::buildForm($builder, $options);
    }
}
