3,16 → 3,16 |
/** |
* Modèle d'accès à la base de données des Collections pour le module Personnes. |
* |
* @package Collection |
* @package Collection |
* @category php 5.2 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
* @copyright 2010 Tela-Botanica |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id$ |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL |
* @version SVN: $Id$ |
* |
*/ |
class PersonneDao extends ColModele { |
class PersonneDao extends Dao { |
const SERVICE_PERSONNE = 'CoelPersonne'; |
const SERVICE_PERSONNE_A_PUBLICATION = 'CoelPublicationAPersonne'; |
const SERVICE_PERSONNE_A_COLLECTION = 'CoelCollectionAPersonne'; |
28,7 → 28,7 |
$donnees = array(); |
if (is_numeric($id)) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE."/$id"; |
$json = file_get_contents($url); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
if ($donnees['nbElements'] == 1) { |
$donnees = $donnees['personnes'][0]; |
43,11 → 43,27 |
* @param integer l'id de la personne. |
* @return array un tableau contenant les informations sur les publications liées à la personne. |
*/ |
public function getPersonneAPublication($id_personne) { |
public function getPublicationsLiees($id_personne) { |
$donnees = $this->getPersonneAPublication($id_personne); |
return $donnees['publicationsAPersonne']; |
} |
|
/** |
* Retourne le nombre des publications liées à une personne. |
* |
* @param integer l'id de la personne. |
* @return integer le nombre de publications liées à la personne. |
*/ |
public function getNbrePublicationsLiees($id_personne) { |
$donnees = $this->getPersonneAPublication($id_personne); |
return $donnees['nbElements']; |
} |
|
private function getPersonneAPublication($id_personne) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_PUBLICATION."/*/$id_personne/2361,2362,2363"; |
$json = file_get_contents($url); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
return $donnees['publicationsAPersonne']; |
return $donnees; |
} |
|
/** |
58,8 → 74,8 |
*/ |
public function getPersonneACollection($id_personne) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_COLLECTION."/*/*/$id_personne"; |
$url .= '?orderby='.urlencode("cc_nom ASC"); |
$json = file_get_contents($url); |
$this->addOrdre('cc_nom', self::ORDRE_ASCENDANT); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
return $donnees['collectionsAPersonne']; |
} |
72,8 → 88,8 |
*/ |
public function getPersonneAStructure($id_personne) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_STRUCTURE."/*/*/$id_personne"; |
$url .= '?orderby='.urlencode("cs_nom ASC"); |
$json = file_get_contents($url); |
$this->addOrdre('cs_nom', self::ORDRE_ASCENDANT); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
return $donnees['structuresAPersonne']; |
} |