<?php

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

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

class ImageTypeGuesser extends AbstractAdminRelationTypeGuesser
{
    public function getFormType(): string
    {
        return ImageType::class;
    }

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

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

    public function getDefaultFormTypeOptions(): array
    {
        return array_merge(
            $this->getDefaultRelationFormTypeOptions(),
        );
    }

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

    public function getMatchingPropertyTypes(): array
    {
        return [
            $this->getTargetEntity(),
            'object',
        ];
    }

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