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

Retour vers fetchAllAssociative

parent b322e2e8
No related branches found
No related tags found
No related merge requests found
......@@ -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);
$query->execute();
$value = $query->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 {
$query->execute();
$array = $query->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