Hope someone could help me with this:
I would like to have a column that will contain one and only one TRUE value. I want to set a value of TRUE (or ‘1’) to a row and be assured that the remaining rows are FALSE (or ‘0’).
How this could be achieved with CakePHP?
You can’t enforce this at the database level (well, you can if you use triggers) so you’ll have to enforce it using Model::beforeSave()
Something along the lines of:
When the record is saved, it should be the only one with ‘field’ set to true.