static function findAllForRecipe($recipe_id, $dbh) { $stmt = $dbh->prepare("select * from recipe_ingredients_units riu, ingredients i, units_of_measure u\n\t\twhere recipe_id = :recipe_id and riu.ingredient_id = i.id and u.id = riu.unit_id"); $stmt->bindParam(":recipe_id", $recipe_id); $stmt->execute(); $result = array(); while ($row = $stmt->fetch()) { $rd = new RecipeDetails(); $rd->copyFromRow($row); $result[] = $rd; } return $result; }
function getRecipeDetails($dbh) { $this->recipe_details = RecipeDetails::findAllForRecipe($this->ID, $dbh); }