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

[eluser]WanWizard[/eluser]
For the first one it would be something like:

Code:
$product = new Product;
$product->include_related('photo')->where_related_photo('splash', 1)->get();

and for getting all photo's for a product:

Code:
$photo = new Photo;
$photo->where('product_id', $productid)->get();


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, 11:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB