/** * @param $id * @return array */ protected static function collect_content_for_show_recipe($id) { $recipe = Recipe::find($id); $comments = Comment::find_by_recipe_id($id); $commentators = array(); foreach ($comments as $comment) { $commentators[$comment->chef_id] = Chef::find($comment->chef_id); } $ingredients = Ingredient::find_by_recipe_id($id); $keywords = Keyword::find_by_recipe_id($id); $chef = Chef::find($recipe->chef_id); $content = array('chef' => $chef, 'recipe' => $recipe, 'comments' => $comments, 'commentators' => $commentators, 'ingredients' => $ingredients, 'keywords' => $keywords); return $content; }