Module Recettes : on avance... un peu...
This commit is contained in:
@@ -40,11 +40,13 @@ class MainController extends BaseAdminController
|
||||
|
||||
$contentId = $data['content_id'];
|
||||
$title = $data['title'];
|
||||
$summary = $data['summary'];
|
||||
$difficulty = $data['difficulty'];
|
||||
$numberPeople = $data['people'];
|
||||
$preparationTime = $data['preparation_time'];
|
||||
$cookingTime = $data['cooking_time'];
|
||||
$steps = $data['steps'];
|
||||
$otherIngredients = $data['other_ingredients'];
|
||||
// $steps = $data['steps'];
|
||||
|
||||
if (null !== $title && null !== $contentId && null !== $difficulty && null !== $numberPeople && null !== $preparationTime) {
|
||||
|
||||
@@ -58,20 +60,22 @@ class MainController extends BaseAdminController
|
||||
$recipeId = $recipe->getId();
|
||||
|
||||
$recipe->setContentId($contentId);
|
||||
$recipe->setSummary($summary);
|
||||
$recipe->setTitle($title);
|
||||
$recipe->setDifficulty($difficulty);
|
||||
$recipe->setPeople($numberPeople);
|
||||
$recipe->setPreparationTime($preparationTime);
|
||||
$recipe->setCookingTime($cookingTime);
|
||||
$recipe->setOtherIngredients($otherIngredients);
|
||||
$recipe->save($con);
|
||||
$con->commit();
|
||||
|
||||
if (!$nouvelleRecette)
|
||||
{
|
||||
// On supprime les étapes pour les recréer par la suite.
|
||||
$steps = RecipeStepsQuery::create()->findByRecipeId($recipeId);
|
||||
$steps->delete($con);
|
||||
$con->commit();
|
||||
// $steps = RecipeStepsQuery::create()->findByRecipeId($recipeId);
|
||||
// $steps->delete($con);
|
||||
// $con->commit();
|
||||
}
|
||||
/*
|
||||
foreach ($steps as $step) {
|
||||
|
||||
Reference in New Issue
Block a user