add comments

This commit is contained in:
Thomas Rubini 2023-01-26 21:35:54 +01:00
parent 1e75a5df58
commit 2a54dd3192
No known key found for this signature in database
GPG Key ID: C7D287C8C1CAC373

View File

@ -79,14 +79,18 @@ final class RecipeController
Session::login_or_die();
$O_recipe = RecipeModel::createEmpty();
// fill basic recipe attribtues
self::fillRecipeFromPostParams($O_recipe, $A_postParams);
$O_recipe->insert();
// update img if necessary
$fp = Utils::tryProcessImg("recipeImage");
if($fp !== null) {
$O_recipe->updateImg($fp);
}
// handle ingredients
$A_ingredientNames = Utils::getOrDie($A_postParams, "recipeIngredientNames");
$A_ingredientQuantities = Utils::getOrDie($A_postParams, "recipeIngredientQuantities");
@ -120,14 +124,17 @@ final class RecipeController
}
}
// fill basic recipe attribtues
self::fillRecipeFromPostParams($O_recipe, $A_postParams);
$O_recipe->update();
// update img if necessary
$fp = Utils::tryProcessImg("recipeImage");
if($fp !== null) {
$O_recipe->updateImg($fp);
}
// handle ingredients
$A_ingredientNames = Utils::getOrDie($A_postParams, "recipeIngredientNames");
$A_ingredientQuantities = Utils::getOrDie($A_postParams, "recipeIngredientQuantities");