31 |
aurelien |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
class GestionTriple extends JRestService {
|
|
|
4 |
|
|
|
5 |
protected function obtenirValeursListeParId($id_liste) {
|
|
|
6 |
|
|
|
7 |
$requete = 'SELECT * FROM ods_triple WHERE ot_ce_parent ='.$this->proteger($id_liste);
|
|
|
8 |
$resultat = $this->executerRequete($requete);
|
|
|
9 |
|
|
|
10 |
return $resultat;
|
|
|
11 |
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
protected function obtenirValeursListeParAbreviation($abreviation_triple) {
|
|
|
15 |
|
33 |
aurelien |
16 |
$requete = 'SELECT * FROM ods_triples WHERE ot_ce_parent = (SELECT ot_id_triple FROM ods_triples WHERE ot_cle ='.$this->proteger($abreviation_triple).')';
|
31 |
aurelien |
17 |
$resultat = $this->executerRequete($requete);
|
|
|
18 |
|
33 |
aurelien |
19 |
return $this->grouperResultat($resultat);
|
31 |
aurelien |
20 |
|
|
|
21 |
}
|
|
|
22 |
|
|
|
23 |
protected function obtenirValeurTripleParId($id_triple) {
|
|
|
24 |
|
|
|
25 |
$requete = 'SELECT * FROM ods_triple WHERE ot_id_triple = '.$this->proteger($id_triple);
|
|
|
26 |
$resultat = $this->executerRequete($requete);
|
|
|
27 |
|
|
|
28 |
return $resultat['ot_valeur'];
|
|
|
29 |
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
protected function obtenirValeurTripleParAbreviation($abreviation_triple) {
|
|
|
33 |
|
|
|
34 |
$requete = 'SELECT * FROM ods_triple WHERE ot_cle = '.$this->proteger($abreviation_triple);
|
|
|
35 |
$resultat = $this->executerRequete($requete);
|
|
|
36 |
|
|
|
37 |
return $resultat['ot_valeur'];
|
|
|
38 |
|
|
|
39 |
}
|
|
|
40 |
|
33 |
aurelien |
41 |
private function grouperResultat($tableau_resultat_requete_triple) {
|
|
|
42 |
|
|
|
43 |
$tableau_resultat_requete_triple_ordonne = array();
|
|
|
44 |
|
|
|
45 |
foreach($tableau_resultat_requete_triple as $valeur_triple) {
|
|
|
46 |
$tableau_resultat_requete_triple_ordonne[$valeur_triple['ot_id_triple']] = $valeur_triple;
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
return $tableau_resultat_requete_triple_ordonne;
|
|
|
50 |
}
|
|
|
51 |
|
31 |
aurelien |
52 |
}
|
|
|
53 |
|
|
|
54 |
?>
|