Hello! I've got a bit of an issue going on while trying to update one of my models. I have two enumerated fields in my database, i'll call them cat and dog.
So say cat has "black, white, grey" and dog has "orange, green, purple" as their enumerated values. If I try to update either of them through their active record instance as
$ar->cat = 2
$ar->dog = 3
it works fine and is updated properly.
However, if I was to say
$ar->cat = "white"
$ar->dog = "purple"
the cat field is set to blank, but the dog field is properly set.
In trying to figure this out, I decided to do a print_r on the activerecord instance and noticed while both fields have a dbType of enum, cat's 'type' property is integer while dog's is string.
I checked the database structure and nothing there seems to dictate this, so I assume it is somewhere within yii but I can't figure out where. There doesn't seem to be any definition of this in the model class for this table either, and though cat is set to integer, it returns the enumerated string when i try to output its value.
Does anybody have any ideas with this? If anybody needs more details on the issue I'll be happy to provide them, thanks!
bit is a data type field. I often use it for flags such as a column title 'loggedIn' … i would use a bit(1) field with a value of 0 or 1.
I came across a problem a while back using a bit field. I eventually just changed the data type to tinyint, but I'd rather figure out what is going on. is showing up in the views for the bit field. If I view the source in FF, that's in the source as well. Has anyone else seen this?