improving ZMDatabase
With 0.9.2 out of the way, I’ll be back to improving the ZenMagick database layer.
The new release fixes a lot of stuff and adds quite a few handy things, but there are also still gaps that mean it can’t be used everywhere.
Also, it still doesn’t work well with the zm_phpbb plugin, as the switch between databases is not handled properly.
The next thing, though, is to get clean up the mapping file, so that there are no duplicate field names any more. This is actually not so much a bug, but a something that can cause problems with the way the zen-cart tables are arranged. What happens is that joins and such will cause columns with the same name being read from different tables. The result is that there is no predictable (at least not easily) way to tell which one will *win* and be the one in the model class. Making sure that fields are mapped to different properties should help.
Another problem is the way that all primary keys are mapped to ‘id’. While this seemed a good idea as far as the API is concerned, it suffers from the same isses as oulined above. In particular the attribute related queries did create some regressions as the wrong ‘id’ was used… (That is also the reason why all attribute price tests currently do fail).
Luckily, with the magic get/set methods in ZMModel that should be easily fixed.
