Thursday, March 20, 2008

how to deal with enum in symfony

type: enum

Simulating an enum column type in the model

As enum is a MySQL specific type, you cannot have a column of type
enum in your schema.yml (which is database-independent). One solution
to simulate it is to create another table to store the different
possible values. But the Model class offer an alternative solution
that is probably more elegant.

please see detail on: http://www.symfony-project.org/snippets/snippet/107

No comments: