Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 900 → Rev 901

/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));
$val = $this->consulterHref($url);
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,18 → 311,17
 
/** 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) {
$nom = '';
$req = 'SELECT nom FROM '.$this->table.' WHERE id = '.$this->getBdd()->proteger($classe_id);
$res = $this->getBdd()->recuperer($req);
if ($res) {
$nom = $res['nom'];
} else {
$e = "Données introuvables dans la table $this->table";
$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e);
Debug::printr($req);
}
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 . ' -- ' . __FILE__ . ':' . __LINE__);
if ($res) {
$nom = $res['nom'];
} else {
$e = "Données introuvables dans la table $this->table";
$this->renvoyerErreur(RestServeur::HTTP_CODE_RESSOURCE_INTROUVABLE, $e);
Debug::printr($req);
}
return $nom;
}