B
B
BonBon Slick2017-12-09 16:28:00
Doctrine ORM
BonBon Slick, 2017-12-09 16:28:00

Doctrine how to make enum field in table via annotations?

In Larval, to create an enum field, I did this:
->enum('name', ['val1', 'val2'])
In the doctrine in the annotations, setting the type of the field there is no option enum
docs.doctrine-project.org/en/latest/reference/basi...
And I want the field to be equal only to certain constants from the array .
Please tell me how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jaxel, 2017-12-09
@BonBonSlick

You can't do it with annotations. And in general, I do not advise using a real enum. Better to use varchars mapping.
docs.doctrine-project.org/projects/doctrine-orm/en...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question