<?php

namespace AutoAdmin\Bundle\Admin\Form\TypeGuesser\Guesser\Relation;

use Doctrine\ORM\Mapping\ManyToOne;

class ManyToOneRelationGuesser extends AbstractAdminRelationTypeGuesser
{
    public function getRelationType(): string
    {
        return ManyToOne::class;
    }

    public function getMatchingConfigStrings(): array
    {
        return [
            'many-to-one',
            'many_to_one',
            'manyToOne',
            'entity-many-to-one',
            'entity_many_to_one',
            'entityManyToOne',
            'entity',
        ];
    }

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

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

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