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 93 2010-06-21 14:15:13Z jpm $
|
12 |
* @version SVN: $Id: PersonneDao.php 117 2010-06-28 10:27:53Z 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';
|
Line 18... |
Line 19... |
18 |
|
19 |
|
19 |
/**
|
20 |
/**
|
20 |
* Retourne l'ensemble des information d'une personne.
|
21 |
* Retourne l'ensemble des information d'une personne.
|
21 |
*
|
22 |
*
|
Line 43... |
Line 44... |
43 |
*/
|
44 |
*/
|
44 |
public function getPersonneAPublication($id_personne) {
|
45 |
public function getPersonneAPublication($id_personne) {
|
45 |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_PUBLICATION."/*/$id_personne/2361,2362,2363";
|
46 |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_PUBLICATION."/*/$id_personne/2361,2362,2363";
|
46 |
$json = file_get_contents($url);
|
47 |
$json = file_get_contents($url);
|
47 |
$donnees = json_decode($json, true);
|
48 |
$donnees = json_decode($json, true);
|
48 |
$this->nettoyerTableauDeTableauxAssoc($donnees['publicationsAPersonne']);
|
- |
|
49 |
return $donnees['publicationsAPersonne'];
|
49 |
return $donnees['publicationsAPersonne'];
|
50 |
}
|
50 |
}
|
Line -... |
Line 51... |
- |
|
51 |
|
- |
|
52 |
/**
|
- |
|
53 |
* Retourne l'ensemble des collections liées à une personne.
|
- |
|
54 |
*
|
- |
|
55 |
* @param integer l'id de la personne.
|
- |
|
56 |
* @return array un tableau contenant les informations sur les collections liées à la personne.
|
- |
|
57 |
*/
|
- |
|
58 |
public function getPersonneACollection($id_personne) {
|
- |
|
59 |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_COLLECTION."/*/*/$id_personne";
|
- |
|
60 |
$url .= '?orderby='.urlencode("cc_nom ASC");
|
- |
|
61 |
$json = file_get_contents($url);
|
- |
|
62 |
$donnees = json_decode($json, true);
|
- |
|
63 |
return $donnees['collectionsAPersonne'];
|
- |
|
64 |
}
|
51 |
|
65 |
|
52 |
public function getPersonneNomComplet($id) {
|
66 |
public function getPersonneNomComplet($id) {
|
53 |
$nom_complet = '';
|
67 |
$nom_complet = '';
|
54 |
$donnees = $this->getPersonne($id);
|
68 |
$donnees = $this->getPersonne($id);
|
55 |
if (isset($donnees['nbElements']) && $donnees['nbElements'] >= 1) {
|
69 |
if (isset($donnees['nbElements']) && $donnees['nbElements'] >= 1) {
|