0

i'm new to php and codeigniter but i have experience with pylons and sqlalchemy.

there you define model classes and then you use command something like "paster setup-app development.ini" and (paster?) creates tables for you and you dont have to write any sql code...

i was trying this with codeigniter and datamapper but so far i'm not sure if it is possible. so here i am asking you if it is possible?

i am very confused because in "models/" you can put your own classes (like in sqlalchemy). in these classes you define every attribute, relationship and other stuff. so why would you need to write the same thing 2 times? (1st in this class 2nd in sql script)

4

1 回答 1

1

这是不可能的,Datamapper 实现了期望表存在的 Active Record 模式。

无需在 Datamapper 模型中定义任何属性,它将从关联的表中获取(并缓存)。

于 2012-04-06T20:19:41.693 回答