Commit 00082e3c authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Exception gestion complétude (TBL_DOSSIER)

parent 144c710e
Loading
Loading
Loading
Loading
+1 −1
Changes for module/Application/src/Application/Controller/IntervenantDossierController.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ class IntervenantDossierController extends AbstractController
            $this->updateTableauxBord($intervenantDossier->getIntervenant());
        }
        $intervenantDossierValidation = $this->getServiceDossier()->getValidation($intervenant);
        //$tblDossierIntervenant        = $this->getServiceDossier()->getCompletude($intervenantDossier);

        /* Initialisation du formulaire */
        $form = $this->getIntervenantDossierForm($intervenant);
        $form->bind($intervenantDossier);
+6 −1
Changes for module/Application/src/Application/Service/DossierService.php: 6 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ use Application\Service\Traits\IntervenantServiceAwareTrait;
use Application\Service\Traits\SourceServiceAwareTrait;
use Application\Service\Traits\StatutIntervenantServiceAwareTrait;
use Application\Service\Traits\ValidationServiceAwareTrait;
use Doctrine\ORM\NoResultException;

/**
 * Description of Intervenant Dossier
@@ -163,12 +164,16 @@ class DossierService extends AbstractEntityService

    public function getCompletude(IntervenantDossier $intervenantDossier)
    {

        $qb = $this->getEntityManager()->getRepository('Application\Entity\Db\TblDossier')->createQueryBuilder('tbld');
        $qb->where("tbld.intervenant = :intervenant");
        $qb->setParameter('intervenant', $intervenantDossier->getIntervenant());
        try {
            $tblDossierIntervenant = $qb->getQuery()->setMaxResults(1)->getSingleResult();;
        } catch (NoResultException $e) {
            throw new \Exception('Impossible de trouver la complétude du dossier dans tbl_dossier');
        }
        /**
         * }
         * @var TblDossier $tblDossierIntervenant
         */