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

Ajustement

parent f3b1e6c7
No related branches found
No related tags found
No related merge requests found
Pipeline #35375 failed
...@@ -134,11 +134,13 @@ class ParametreService ...@@ -134,11 +134,13 @@ class ParametreService
throw new ParametreNotFoundException("Aucun paramètre de trouvé pour les codes [Categorie: ".$categorieCode.",Parametre: ".$parametreCode."]"); throw new ParametreNotFoundException("Aucun paramètre de trouvé pour les codes [Categorie: ".$categorieCode.",Parametre: ".$parametreCode."]");
} }
if ($parametre->getValeur() === null) return null;
if ($parametre->getValeursPossibles() === Parametre::TYPE_STRING) return $parametre->getValeur(); if ($parametre->getValeursPossibles() === Parametre::TYPE_STRING) return $parametre->getValeur();
// Note : attention en bd c'est un string du coup si === alors 'true' // Note : attention en bd c'est un string du coup si === alors 'true'
if ($parametre->getValeursPossibles() === Parametre::TYPE_BOOLEAN && $parametre->getValeur() !== null) return ($parametre->getValeur() === 'true'); if ($parametre->getValeursPossibles() === Parametre::TYPE_BOOLEAN) return ($parametre->getValeur() === 'true');
if ($parametre->getValeursPossibles() === Parametre::TYPE_NUMBER && $parametre->getValeur() !== null) return ((int) $parametre->getValeur()); 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é"); 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 to comment