DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]James McMurray[/eluser]
[quote author="tomdelonge" date="1286270677"]Alright, so right now in my controller I get an object using dmz. Let's call it products: $p = new Product(); $p->get(); Then I pass it to the view, and there loop through and find the reviews for each: foreach($products as $product) { $product->review->get(); } Now this is obviously a simplified version. But basically, I need to loop through the products and get the associated reviews. I need to do all of this in my controller. How can I do this there? How can I populate each individual record in the products object?[/quote] $object->include_related($model, $fields = NULL, $prefix = TRUE, $instantiate = FALSE) |
Welcome Guest, Not a member yet? Register Sign In |