remove all functions to preload recipe attributes
This commit is contained in:
parent
ddc2c72d58
commit
fcf69dad56
@ -10,7 +10,7 @@ final class RecipeController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO MAKE THE VIEW USE THE NEW DATA FORMAT
|
//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) {
|
if ($O_recipe === null) {
|
||||||
throw new HTTPSpecialCaseException(404);
|
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) {
|
if ($O_recipe === null) {
|
||||||
throw new HTTPSpecialCaseException(404);
|
throw new HTTPSpecialCaseException(404);
|
||||||
}
|
}
|
||||||
|
@ -147,30 +147,6 @@ final class RecipeModel
|
|||||||
return $this->A_APPRS;
|
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
|
//TODO: return array object
|
||||||
public static function searchRecipesByName($S_query)
|
public static function searchRecipesByName($S_query)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user