Elao/PhpEnums

v2 integration with easyadmin

Opened this issue · 2 comments

Hello,

I am having issues integrating version 2 with easyadmin (version 1 worked like a charm).
Anyone already able to get this to work?

Thanks.

What seems to be the issue?

With v1 I used to do something like was described in the README:

public function configureFields(string $pageName): iterable
{
    return [TextField::new('answerType')->
        setFormType(EnumType::class)->
        setFormTypeOptions(['enum_class' => AnswerTypeEnum::class])
    ];
}

Similarly, with v2, something like the following does not work out of the box. Especially not with FlagBagEnums

public function configureFields(string $pageName): iterable
{
    return [TextField::new('answerType')->
        setFormType(FlagBagType::class)->
        setFormTypeOptions(['class' => AnswerTypeEnum::class])
    ];
}