What I personally would do is add an afterFind callback for the models you want to change status with.
class MyModel extends Model { ... // the rest of model code function afterFind($results) { foreach ($results as $key => $val) { if (isset($val['MyModel']['status'])) { $results[$key]['MyModel']['status_text'] = $results[$key]['MyModel']['status'] ? 'Yes' : 'No'; } } return $results; } }
Thus, you still have all the fields, if the form is normal, and you can, for example, update and save your model, which does not work if you change the int value obtained from db to a string.
source share