Commit f27ca888 authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

rollback si des erreurs ont eu lien avant

parent 4f0882b4
Loading
Loading
Loading
Loading
+5 −0
Changes for module/Plafond/src/Processus/PlafondProcessus.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
namespace Plafond\Processus;

use Application\Processus\AbstractProcessus;
use Doctrine\DBAL\ConnectionException;
use Laminas\Mvc\Plugin\FlashMessenger\FlashMessenger;
use Plafond\Interfaces\PlafondDataInterface;
use Plafond\Service\PlafondServiceAwareTrait;
@@ -64,8 +65,12 @@ class PlafondProcessus extends AbstractProcessus
        }

        if ($passed) {
            try {
                $this->getEntityManager()->commit();
                $this->getServicePlafond()->calculerDepuisEntite($entity); // on met à jour les TBLs
            }catch(ConnectionException $e){
                $this->getEntityManager()->rollback();
            }
        } else {
            $this->getEntityManager()->rollback();
        }