Commit b2939e6e authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Traitement dans un transaction pour rollback

parent 35d2afaf
Loading
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -43,13 +43,7 @@ class HasIndicateursService
                $categorie = new Categorie();
                $categorie->setCode($categorieCode);
                $categorie->setLibelle($itemCategorie['libelle']);
                try {
                $this->getCategorieService()->create($categorie);
                } catch(Exception $e) {
                    $log .= "Un problème s'est produit lors de la création de la catégorie d'indicateur [$categorieCode].\n" . $e->getMessage() . "\n";
                    $this->getObjectManager()->rollback();
                    $this->getObjectManager()->close();
                }
            }
            foreach ($itemCategorie['indicateurs'] as $itemIndicateur) {
                $indicateur = new Indicateur();