Welcome Guest, Not a member yet? Register   Sign In
DataMapper ORM - How to get all of a model and each instance's related data
#2

[eluser]WanWizard[/eluser]
There is no option at the moment to get all products with all related has_many objects, in one go. You can do it with has_one's, using include_related() and the $instantiate flag.

This hasn't been implemented for has_many in DM because is has a design which is over 5 years old, from the time that CI was PHP4, and instantiating many objects was (and still is to an extend) very expensive. If you have 500 products, with on average 10 photo's, you'll have to hydrate 5000 objects. That is never going to be fast.


Messages In This Thread
DataMapper ORM - How to get all of a model and each instance's related data - by El Forum - 04-21-2013, 03:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB