Hi. I have byte(1) column in my table for store true/false values. I would like to use in my models and forms for Yes/No selectors e.g.
$this->add(new Select('approved', [
1 => 'Yes',
0 => 'No'
]));
When I'm trying to save model I get:
: String data, right truncated: 1406 Data too long for column 'approved'
Dumping 'approved's value prior to saving gives me:
string '1' (length=1)
However when I'm getting record from database I have
int 1
for the same field.
The only sollution I can think about is to do intval on field beforeSave.
My question is: is it the best way to work with byte(1)? Or it's better to change database column to Y/N for instance?