Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 117 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 117 Rev 120
Line 7... Line 7...
7
 * @category	php 5.2
7
 * @category	php 5.2
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id: PersonneDao.php 117 2010-06-28 10:27:53Z jpm $
12
 * @version		SVN: $Id: PersonneDao.php 120 2010-06-28 12:38:54Z jpm $
13
 *
13
 *
14
 */
14
 */
15
class PersonneDao extends ColModele {
15
class PersonneDao extends ColModele {
16
	const SERVICE_PERSONNE = 'CoelPersonne';
16
	const SERVICE_PERSONNE = 'CoelPersonne';
17
	const SERVICE_PERSONNE_A_PUBLICATION = 'CoelPublicationAPersonne';
17
	const SERVICE_PERSONNE_A_PUBLICATION = 'CoelPublicationAPersonne';
18
	const SERVICE_PERSONNE_A_COLLECTION = 'CoelCollectionAPersonne';
18
	const SERVICE_PERSONNE_A_COLLECTION = 'CoelCollectionAPersonne';
-
 
19
	const SERVICE_PERSONNE_A_STRUCTURE = 'CoelStructureAPersonne';
Line 19... Line 20...
19
 
20
 
20
	/**
21
	/**
21
	 * Retourne l'ensemble des information d'une personne.
22
	 * Retourne l'ensemble des information d'une personne.
22
	 * 
23
	 * 
Line 61... Line 62...
61
		$json = file_get_contents($url);
62
		$json = file_get_contents($url);
62
		$donnees = json_decode($json, true);
63
		$donnees = json_decode($json, true);
63
		return $donnees['collectionsAPersonne'];
64
		return $donnees['collectionsAPersonne'];
64
	}
65
	}
Line -... Line 66...
-
 
66
	
-
 
67
	/**
-
 
68
	 * Retourne l'ensemble des structures liées à une personne.
-
 
69
	 * 
-
 
70
	 * @param integer l'id de la personne.
-
 
71
	 * @return array un tableau contenant les informations sur les structures liées à la personne.
-
 
72
	 */
-
 
73
	public function getPersonneAStructure($id_personne) {
-
 
74
		$url = $this->url_jrest.self::SERVICE_PERSONNE_A_STRUCTURE."/*/*/$id_personne";
-
 
75
		$url .= '?orderby='.urlencode("cs_nom ASC");
-
 
76
		$json = file_get_contents($url);
-
 
77
		$donnees = json_decode($json, true);
-
 
78
		return $donnees['structuresAPersonne'];
-
 
79
	}
65
	
80
	
66
	public function getPersonneNomComplet($id) {
81
	public function getPersonneNomComplet($id) {
67
		$nom_complet = '';
82
		$nom_complet = '';
68
		$donnees = $this->getPersonne($id);
83
		$donnees = $this->getPersonne($id);
69
		if (isset($donnees['nbElements']) && $donnees['nbElements'] >= 1) {
84
		if (isset($donnees['nbElements']) && $donnees['nbElements'] >= 1) {