From 41dca713343ce3f25a5bcebbad228f9b3b7426bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= <laurent.lecluse@unicaen.fr> Date: Mon, 30 Nov 2020 17:11:18 +0100 Subject: [PATCH] Update ServiceProcessus.php --- .../Application/Processus/Intervenant/ServiceProcessus.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/Application/src/Application/Processus/Intervenant/ServiceProcessus.php b/module/Application/src/Application/Processus/Intervenant/ServiceProcessus.php index 84f7187bb1..adfc3ea395 100644 --- a/module/Application/src/Application/Processus/Intervenant/ServiceProcessus.php +++ b/module/Application/src/Application/Processus/Intervenant/ServiceProcessus.php @@ -19,13 +19,13 @@ class ServiceProcessus $intervenant = $this->getServiceIntervenant()->getPrecedent($intervenant); if (!$intervenant) return false; - $sql = "SELECT valide FROM tbl_service WHERE intervenant_id = :intervenant AND type_volume_horaire_id = :typeVolumeHoraire AND valide > 0"; - $res = $this->getEntityManager()->getConnection()->fetchOne($sql, [ + $sql = "SELECT valide FROM tbl_service WHERE intervenant_id = :intervenant AND type_volume_horaire_id = :typeVolumeHoraire AND valide > 0 AND ROWNUM = 1"; + $res = $this->getEntityManager()->getConnection()->fetchAll($sql, [ 'intervenant' => $intervenant->getId(), 'typeVolumeHoraire' => $typeVolumeHoraire->getId(), ]); - return $res !== false; + return !empty($res); } } \ No newline at end of file -- GitLab