I've got a model with a boolean field. I've written beforeSave()
to convert from boolean to 1
& 0
, and afterSave()
& afterFetch()
to convert from 1
& 0
back to boolean.
The beforeSave()
& afterSave()
seem a bit silly to me - is there any way to configure my model so that the value it keeps in memory is boolean, but the value it stores is 1
& 0
?