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

correction du cas booleen pour la methode getValeurForParametre

parent 18e4c9ea
Branches
Tags 6.0.2
No related merge requests found
Pipeline #24514 passed
......@@ -167,8 +167,11 @@ class ParametreService
if ($parametre === null) {
throw new ParametreNotFoundException("Aucun paramètre de trouvé pour les codes [Categorie: ".$categorieCode.",Parametre: ".$parametreCode."]");
}
if ($parametre->getValeursPossibles() === Parametre::TYPE_STRING) return $parametre->getValeur();
if ($parametre->getValeursPossibles() === Parametre::TYPE_BOOLEAN) return ($parametre->getValeur() === true);
// Note : attention en bd c'est un string du coup si === alors 'true'
if ($parametre->getValeursPossibles() === Parametre::TYPE_BOOLEAN) return ($parametre->getValeur() === 'true');
if ($parametre->getValeursPossibles() === Parametre::TYPE_NUMBER) return ((int) $parametre->getValeur());
throw new ParametreMalTypeException("Le type [".$parametre->getValeursPossibles()."] du paramètre [Categorie: ".$categorieCode.",Parametre: ".$parametreCode."] est non géré");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment