/trunk/services/modules/0.1/baseveg/syntaxons/SyntaxonsCommun.php |
---|
30,9 → 30,9 |
protected $champs_recherches = ' * '; |
protected $table_version; |
protected $version_projet = '+' ; |
protected $cache = array(); |
public function __construct(Conteneur $conteneur) { |
$this->Bdd = $conteneur->getBdd(); |
$this->syn = $this->getParametreTableauSpe('synonymes'); |
105,7 → 105,13 |
$ontologie = array(); |
$url = Config::get('url_service_base').Config::get('nom_projet'). |
'/ontologies/'.$code.':'.urlencode(urlencode($valeur)); |
if(array_key_exists($url, $this->cache)) { |
$val = $this->cache[$url]; |
error_log("from cache"); |
} else { |
$val = $this->consulterHref($url); |
$this->cache[$url] = $val; |
} |
$ontologie['niveau.code'] = $valeur; |
$ontologie['niveau.libelle'] = $val->nom; |
$ontologie['niveau.href'] = $url; |
/trunk/services/modules/0.1/baseveg/Ontologies.php |
---|
25,7 → 25,6 |
$resultats = ''; |
$this->table = 'baseveg_ontologies'; |
$this->recupererNomChamp($this->table); |
$this->traiterRessources(); |
312,11 → 311,11 |
/** Recherche par interrogation de la base, le nom de la classe à partir de son identifiant (classe.id) */ |
public function ajouterClasseCorrespondante($classe_id) { |
$nom = null; |
if ($classe_id != 0) { |
if ($classe_id == 0) return NULL; |
$nom = ''; |
$req = 'SELECT nom FROM '.$this->table.' WHERE id = '.$this->getBdd()->proteger($classe_id); |
$res = $this->getBdd()->recuperer($req); |
$res = $this->getBdd()->recuperer($req . ' -- ' . __FILE__ . ':' . __LINE__); |
if ($res) { |
$nom = $res['nom']; |
} else { |
324,7 → 323,6 |
$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e); |
Debug::printr($req); |
} |
} |
return $nom; |
} |