<?php

namespace AutoAdmin\Bundle\Media\Admin\Form\TypeGuesser;

use AutoAdmin\Bundle\Admin\Form\TypeGuesser\Guesser\Relation\AbstractAdminRelationTypeGuesser;
use AutoAdmin\Bundle\Media\Form\Type\Media\LinkedMediaType;
use AutoAdmin\Bundle\Media\Form\Type\Media\LinkedMediaCollectionType;
use Doctrine\ORM\Mapping\OneToMany;

class LinkedMediaCollectionTypeGuesser extends AbstractAdminRelationTypeGuesser
{
    public function getFormType(): string
    {
        return LinkedMediaCollectionType::class;
    }

    public function getRelationType(): string
    {
        return OneToMany::class;
    }

    public function getDefaultRelationFormTypeOptions(): array
    {
        return [
//            'multiple' => true,
//            'expanded' => false,
//            'by_reference' => false,
//        'empty_data'=> [],
//            'entry_type' => LinkedMediaType::class,
//            'entry_options' => [],
        ];
    }

    public function getMatchingConfigStrings(): array
    {
        return [
            'linked_media_collection',
        ];
    }

    public function getMatchingPropertyTypes(): array
    {
        return [
//            'Collection',
//            'array',
        ];
    }

    public function getDefaultFormTypeOptions(): array
    {
        return [
            'entry_type' => LinkedMediaType::class,
            'entry_options' => [],
        ];
    }

    public function priority(): int
    {
        return 50;
    }
}
