<?php

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

use Doctrine\ORM\Mapping\OneToMany;

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

    public function getMatchingConfigStrings(): array
    {
        return [
            'one-to-many',
            'one_to_many',
            'oneToMany',
            'entity-one-to-many',
            'entity_one_to_many',
            'entityOneToMany',
            'entity',
        ];
    }

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

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

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