Line 227... |
Line 227... |
227 |
public function recupererOntologies($valeur, $champs){
|
227 |
public function recupererOntologies($valeur, $champs){
|
228 |
$chps_sans = preg_replace("/_min|_max/", '', $champs);
|
228 |
$chps_sans = preg_replace("/_min|_max/", '', $champs);
|
229 |
$url = Config::get('url_service_base').Config::get('nom_projet').
|
229 |
$url = Config::get('url_service_base').Config::get('nom_projet').
|
230 |
'/ontologies/'.$this->champs_ontologiques[$chps_sans].':'.urlencode(urlencode($valeur));
|
230 |
'/ontologies/'.$this->champs_ontologiques[$chps_sans].':'.urlencode(urlencode($valeur));
|
231 |
try {
|
231 |
try {
|
232 |
$val = $this->consulterHref($url);
|
232 |
$val = $this->getBdd()->recuperer(sprintf(
|
- |
|
233 |
"SELECT a.nom FROM baseflor_ontologies a LEFT JOIN baseflor_ontologies b ON a.id = b.id LEFT JOIN baseflor_ontologies c ON b.classe_id = c.id WHERE".
|
- |
|
234 |
" b.code = BINARY '%s' AND c.code = BINARY '%s' LIMIT 0, 100",
|
- |
|
235 |
$valeur,
|
- |
|
236 |
$this->champs_ontologiques[$chps_sans]));
|
233 |
$this->resultat_json[$champs.'.libelle'] = $val->nom;
|
237 |
$this->resultat_json[$champs.'.libelle'] = $val['nom'];
|
234 |
$this->resultat_json[$champs.'.code'] = $valeur;
|
238 |
$this->resultat_json[$champs.'.code'] = $valeur;
|
235 |
$this->resultat_json[$champs.'.href'] = $url;
|
239 |
$this->resultat_json[$champs.'.href'] = $url;
|
236 |
} catch (Exception $e) {
|
240 |
} catch (Exception $e) {
|
237 |
$this->resultat_json[$champs.'.libelle'] = '';
|
241 |
$this->resultat_json[$champs.'.libelle'] = '';
|
238 |
$this->resultat_json[$champs.'.code'] = '';
|
242 |
$this->resultat_json[$champs.'.code'] = '';
|