Subversion Repositories Applications.annuaire

Rev

Rev 149 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 357
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Modèle d'accès à la base de données des listes
4
 * Modèle d'accès à la base de données des listes
5
 * d'ontologies
5
 * d'ontologies
6
 *
6
 *
7
 * PHP Version 5
7
 * PHP Version 5
8
 *
8
 *
9
 * @package   Framework
9
 * @package   Framework
10
 * @category  Class
10
 * @category  Class
11
 * @author	aurelien <aurelien@tela-botanica.org>
11
 * @author	aurelien <aurelien@tela-botanica.org>
12
 * @copyright 2009 Tela-Botanica
12
 * @copyright 2009 Tela-Botanica
13
 * @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
13
 * @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
14
 * @license   http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
14
 * @license   http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
15
 * @version   SVN: $$Id: ListeAdmin.php 128 2009-09-02 12:20:55Z aurelien $$
15
 * @version   SVN: $$Id: ListeAdmin.php 128 2009-09-02 12:20:55Z aurelien $$
16
 * @link	  /doc/framework/
16
 * @link	  /doc/framework/
17
 *
17
 *
18
 */
18
 */
19
class MappageModele extends Modele {
19
class MappageModele extends Modele {
20
 
20
 
21
	private $config = array();
21
	private $config = array();
22
 
22
 
23
	public function ajouterNouveauMappage($id_annuaire, $nom_champ, $role, $id_metadonnee) {
23
	public function ajouterNouveauMappage($id_annuaire, $nom_champ, $role, $id_metadonnee) {
24
		
24
		
25
		$requete_insertion = 'INSERT INTO annu_triples (at_ce_annuaire, at_ressource, at_action, at_valeur) '.
25
		$requete_insertion = 'INSERT INTO annu_triples (at_ce_annuaire, at_ressource, at_action, at_valeur) '.
26
							 'VALUES ('.$this->proteger($id_annuaire).', '.$this->proteger($nom_champ).', '.$this->proteger($role).', '.$this->proteger($id_metadonnee).')';
26
							 'VALUES ('.$this->proteger($id_annuaire).', '.$this->proteger($nom_champ).', '.$this->proteger($role).', '.$this->proteger($id_metadonnee).')';
27
		
27
		
28
		return $this->requete($requete_insertion);
28
		return $this->requete($requete_insertion);
29
	}
29
	}
-
 
30
	
-
 
31
	public function modifierMappage($id_annuaire, $nom_champ, $role, $id_metadonnee,$id_triple) {
-
 
32
		
-
 
33
		$requete_modification = 'UPDATE annu_triples SET ' .
-
 
34
							 'at_ce_annuaire = '.$this->proteger($id_annuaire).', '.
-
 
35
							 'at_ressource, = '.$this->proteger($nom_champ).', '.
-
 
36
							 'at_action = '.$this->proteger($role).', '.
-
 
37
							 'at_valeur = '.$this->proteger($id_metadonnee).' '.
-
 
38
							 'WHERE at_id = '.$this->proteger($id_triple);
-
 
39
		
-
 
40
		return $this->requete($requete_modification);
-
 
41
	}
30
 
42
 
31
}
43
}
32
?>
44
?>