I have a column in a table defined as following in my yaml file:
myTable:
columns:
value:
type: enum
length: 2
values: ['yes', 'no']
In the code I am trying to insert data into this table but I can't figure out a way to insert the data using the enum text value (ie. 'yes' or 'no').
What I was trying was is something like this:
$obj = new myTable(); // the model for this table
$obj->value = 'yes'; // if I use the numerical value for开发者_StackOverflow中文版 this it works
I am using Doctrine 1.1.0.
Does $obj->setValue('yes') work? And the obvious thing to check are you calling save on the object?
You should not set length with enum type, as its internally treated as integer.
精彩评论