<?php

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

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

class ImageCollectionTypeGuesser extends AbstractAdminRelationTypeGuesser
{
    public function getFormType(): string
    {
        return ImageCollectionType::class;
    }

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

    public function getDefaultRelationFormTypeOptions(): array
    {
        return [
            'multiple' => true,
            'expanded' => false,
            'by_reference' => false,
        ];
    }

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

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

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