remove all functions to preload recipe attributes

This commit is contained in:
Thomas Rubini 2023-01-26 16:25:59 +01:00
parent ddc2c72d58
commit fcf69dad56
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373
2 changed files with 2 additions and 26 deletions

View File

@ -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);
}

View File

@ -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)
{