symfony/demo

EnumType ?

seb-jean opened this issue · 8 comments

Hey :),
Would it be cool to propose the EnumType type in PostType?
What do you think ?

Do you have a good use case for this? Please, feel free to share

I'd prefer if we didn't modify code just to use Enums. Given that it's a PHP feature, not a Symfony feature, we are not required to use it if we don't find a good use case for it.

I've looked into code and the only "group of constants" (a good indicator to introduce Enums) is this one:

public const DELETE = 'delete';
public const EDIT = 'edit';
public const SHOW = 'show';

What do you think? Thanks!

The idea was to show that EnumType exists.

stof commented

@javiereguiluz those are constants for the permission attributes, which must be strings, not enums. So they are not a good candidate.

I close the issue?

stof commented

Btw, if the goal is to showcase the doctrine/orm feature supporting enums (as suggested by the ticket title, as enumType in the name of the configuration setting for that feature), such use case needs to be found in the data model.

Yes, that's it, that's the goal.