diff --git a/module/Application/src/Application/Processus/Intervenant/ServiceProcessus.php b/module/Application/src/Application/Processus/Intervenant/ServiceProcessus.php index 84f7187bb1344d58113cc714617c2b48374d777a..adfc3ea3953ea1a044454b7bcae00982d0dfc213 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