Our project uses UUIDs as primary keys, stored in binary(16) columns in MySQL. However, this becomes a problem when using CGridView, because CBaseListView::renderKeys tries to encode the keys as HTML, which is impossible for binary strings. A solution would be to automatically convert binary columns to their hexadecimal representation and vice versa (using HEX()/UNHEX() in MySQL). Is this possible or is there another way to solve this?
Of course, I had forgotten all about afterFind(). I’m still curious whether this shouldn’t be handled in the framework though, but for now, this is a good workaround. Thanks!
If you’d like to have it in the framework, create a feature request on github to start discussion about how to implement it: https://github.com/yiisoft/yii/issues