recommendations on ORM vs custom data mapper |
[eluser]WanWizard[/eluser]
Sorry, I was correcting it while you were replying. ![]() So yes, you define all relations in the model. There is a one-to-one mapping between models and tables. The model extends the Datamapper class, and as such inherits all datamapper methods for navigating the table and the models related tables. Datamapper also supports out of the box read and write validation rules. This means that no matter where in your code you read or write a record, validation is done only once, and consistent. No more custom checks in your controllers. (p.s. you can use read rules for example to unserialize() a stored serialized array to it can be presented to your code as an array. When you save it, the save validation rule can serialize() it again, completely transparent for your controller. I can't comment on Doctrine. I used v1, and that was bulky and tearjerking slow. I hear v2 is better, but I don't have any comparison. Datamapper is compatible with both Modular CI and Modular Extensions HMVC (it uses CI 2.x packages feature to extend the model search to modules). http://datamapper.wanwizard.eu/pages/get...arted.html gives a nice overview of how things work... |
Welcome Guest, Not a member yet? Register Sign In |