Commit 7fe54cb7 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Correction problème refus candidature (#63060)

parent ec96ea1e
Loading
Loading
Loading
Loading
Loading
+12 −1
Changes for module/Application/src/Service/WorkflowService.php: 12 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Application\Entity\Db\TblWorkflow;
use Application\Entity\Db\WfEtape;
use Application\Entity\WorkflowEtape;
use Application\Service\Traits\ContextServiceAwareTrait;
use Doctrine\ORM\EntityManager;
use Intervenant\Entity\Db\Intervenant;
use Lieu\Entity\Db\Structure;
use Service\Entity\Db\TypeVolumeHoraire;
@@ -286,13 +287,23 @@ class WorkflowService extends AbstractService
                }
            }
        }
        //New EntityManager if closed
        if (!$this->entityManager->isOpen()) {
            $connection = $this->entityManager->getConnection();
            $config     = $this->entityManager->getConfiguration();

            $this->entityManager = new EntityManager(
                $connection,
                $config
            );
        }

        /* Mise à jour des entités */
        if (array_key_exists($intervenant->getId(), $this->feuillesDeRoute)) {
            foreach ($this->feuillesDeRoute[$intervenant->getId()] as $fdr) {
                foreach ($fdr as $etp) {
                    /** @var $etp WorkflowEtape */
                    foreach ($etp->getEtapes() as $etape) {
                        $etape = $this->entityManager->find(TblWorkflow::class, $etape->getId());
                        $this->getEntityManager()->refresh($etape);
                    }
                }