[eluser]Hannes Nevalainen[/eluser]
I have one more idea for your ORM, there should be a good way to create your models from the database especially to fill out the $__columns, variable.. shouldn't be that hard to implement.
I'cant stand the fact that it's querying the database for field metadata every time the model is constructed.. =P haha.
[UGLY CODE WARNING]
An idea is a function that parses all php model source files and then just get the table name from $__table do a $this->db->field_data($__table); and then
Code:
str_replace('var $__columns','$var $__columns = '.$generated_php_array.';',$source_file);
.. a bit ugly but maybe at least you would not have to write all your models ^^.
[/UGLY CODE WARNING]
Another idea is to do a "model_factory" that reads YAML-files and create models from them =) That shouldn't be so much work I think. I think I'll implement one such script myself. =)
EDIT: addition below
I think you should put back the primary key so one could access it like this: $user->id instead of $user->uid(), since you could always save the ID internally in the IR-object and then just ignore it if a someone tries to alter it..
It feels better to use access it like a property (an another advantage is that i don't have to change in my code =P, haha)
I understand why you have wrapped it in the uid(), but I think it would be a better approach to just ignore it onSave. (I don't know the internalls of IR but I can't imagine it would be a big brainer)
//Hannes
P.S Good to hear that I'm not annoying you ^^