Skip to content
Snippets Groups Projects
Commit 8ccdc287 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'master' of https://git.unicaen.fr/lib/unicaen/indicateur into HEAD

parents 878e9389 c1448033
No related branches found
No related tags found
No related merge requests found
Pipeline #22896 passed
......@@ -6,8 +6,8 @@ use DateTime;
use Doctrine\DBAL\Exception as DBA_Exception;
use Doctrine\DBAL\Driver\Exception as DBA_Driver_Exception;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Exception\ORMException;
use Doctrine\ORM\NonUniqueResultException;
use Doctrine\ORM\ORMException;
use DoctrineModule\Persistence\ProvidesObjectManager;
use Exception;
use RuntimeException;
......@@ -72,13 +72,12 @@ class IndicateurService {
{
try {
$sql = "SELECT EXISTS (SELECT FROM pg_matviews WHERE matviewname='" . $viewname . "')";
$query = $this->getObjectManager()->getConnection()->prepare($sql);
$execute = $query->execute();
$value = $execute->fetchOne();
$res = $this->getObjectManager()->getConnection()->executeQuery($sql, [], []);
$tmp = $res->fetchAllAssociative();
} catch (Exception $e) {
return false;
}
return $value;
return $tmp[0]['exists'];
}
/**
......@@ -98,12 +97,12 @@ class IndicateurService {
throw new RuntimeException("Un problème est survenu lors de la récupération de la session.", 0, $e);
}
try {
$execute = $query->execute();
$array = $execute->fetchAll();
$res = $this->getObjectManager()->getConnection()->executeQuery($sql, [], []);
$tmp = $res->fetchAllAssociative();
} catch (DBA_Driver_Exception $e) {
throw new RuntimeException("Un problème est survenu lors de la récupération de des données de l'indicateur.", 0, $e);
}
return $array;
return $tmp;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment