allow to set recipe img when inserting
This commit is contained in:
parent
96c77453e2
commit
1e75a5df58
@ -72,11 +72,6 @@ final class RecipeController
|
||||
$i++;
|
||||
}
|
||||
$O_recipe->S_RECIPE = substr($S_recipe, 2);
|
||||
|
||||
$fp = Utils::tryProcessImg("recipeImage");
|
||||
if($fp !== null) {
|
||||
$O_recipe->updateImg($fp);
|
||||
}
|
||||
}
|
||||
|
||||
public function createAction(Array $A_urlParams = null, Array $A_postParams = null)
|
||||
@ -87,6 +82,11 @@ final class RecipeController
|
||||
self::fillRecipeFromPostParams($O_recipe, $A_postParams);
|
||||
$O_recipe->insert();
|
||||
|
||||
$fp = Utils::tryProcessImg("recipeImage");
|
||||
if($fp !== null) {
|
||||
$O_recipe->updateImg($fp);
|
||||
}
|
||||
|
||||
$A_ingredientNames = Utils::getOrDie($A_postParams, "recipeIngredientNames");
|
||||
$A_ingredientQuantities = Utils::getOrDie($A_postParams, "recipeIngredientQuantities");
|
||||
|
||||
@ -123,6 +123,11 @@ final class RecipeController
|
||||
self::fillRecipeFromPostParams($O_recipe, $A_postParams);
|
||||
$O_recipe->update();
|
||||
|
||||
$fp = Utils::tryProcessImg("recipeImage");
|
||||
if($fp !== null) {
|
||||
$O_recipe->updateImg($fp);
|
||||
}
|
||||
|
||||
$A_ingredientNames = Utils::getOrDie($A_postParams, "recipeIngredientNames");
|
||||
$A_ingredientQuantities = Utils::getOrDie($A_postParams, "recipeIngredientQuantities");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user