diff --git a/Controllers/RecipeController.php b/Controllers/RecipeController.php index df03f86..948b733 100644 --- a/Controllers/RecipeController.php +++ b/Controllers/RecipeController.php @@ -10,7 +10,7 @@ final class RecipeController } //TODO MAKE THE VIEW USE THE NEW DATA FORMAT - $O_recipe = RecipeModel::getFullRecipeWithApprs($A_urlParams[0]); + $O_recipe = RecipeModel::getByID($A_urlParams[0]); if ($O_recipe === null) { throw new HTTPSpecialCaseException(404); } @@ -30,7 +30,7 @@ final class RecipeController } - $O_recipe = RecipeModel::getFullRecipeById($A_urlParams[0]); + $O_recipe = RecipeModel::getByID($A_urlParams[0]); if ($O_recipe === null) { throw new HTTPSpecialCaseException(404); } diff --git a/Models/RecipeModel.php b/Models/RecipeModel.php index dfa08c6..4004e6d 100644 --- a/Models/RecipeModel.php +++ b/Models/RecipeModel.php @@ -147,30 +147,6 @@ final class RecipeModel return $this->A_APPRS; } - public function getFullRecipe() - { - $this->getAuthor(); - $this->getDifficulty(); - $this->getIngredients(); - } - - public static function getFullRecipeById($I_id) - { - $O_recipe = self::getByID($I_id); - $O_recipe->getFullRecipe(); - return $O_recipe; - } - - public static function getFullRecipeWithApprs($I_id) - { - $O_recipe = self::getFullRecipeById($I_id); - if ($O_recipe === null)return null; - - $O_recipe->getApprs(); - - return $O_recipe; - } - //TODO: return array object public static function searchRecipesByName($S_query) { diff --git a/Views/recipe/view.php b/Views/recipe/view.php index 03f8cf3..5b3d3b0 100644 --- a/Views/recipe/view.php +++ b/Views/recipe/view.php @@ -9,7 +9,7 @@ $O_recipe = $A_view["RECIPE"];

S_NAME ?>

-

I_TIME ?> — O_DIFFICULTY->S_NAME ?>

+

I_TIME ?> — getDifficulty()->S_NAME ?>

S_DESCR ?>