17,6 → 17,8 |
const SERVICE_PERSONNE_A_PUBLICATION = 'CoelPublicationAPersonne'; |
const SERVICE_PERSONNE_A_COLLECTION = 'CoelCollectionAPersonne'; |
const SERVICE_PERSONNE_A_STRUCTURE = 'CoelStructureAPersonne'; |
|
private $cache = array(); |
|
/** |
* Retourne l'ensemble des information d'une personne. |
60,9 → 62,15 |
} |
|
private function getPersonneAPublication($id_personne) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_PUBLICATION."/*/$id_personne/2361,2362,2363"; |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
$cache =& $this->cache['PersonneAPublication']; |
if (isset($cache[$id_personne])) { |
$donnees = $cache[$id_personne]; |
} else { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_PUBLICATION."/*/$id_personne/2361,2362,2363"; |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
$cache[$id_personne] = $donnees; |
} |
return $donnees; |
} |
|
72,28 → 80,78 |
* @param integer l'id de la personne. |
* @return array un tableau contenant les informations sur les collections liées à la personne. |
*/ |
public function getPersonneACollection($id_personne) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_COLLECTION."/*/*/$id_personne"; |
$this->addOrdre('cc_nom', self::ORDRE_ASCENDANT); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
public function getCollectionsLiees($id_personne) { |
$donnees = $this->getPersonneACollection($id_personne); |
return $donnees['collectionsAPersonne']; |
} |
|
/** |
* Retourne le nombre de collections liées à une personne. |
* |
* @param integer l'id de la personne. |
* @return integer le nombre de collections liées à la personne. |
*/ |
public function getNbreCollectionsLiees($id_personne) { |
$donnees = $this->getPersonneACollection($id_personne); |
return $donnees['nbElements']; |
} |
|
private function getPersonneACollection($id_personne) { |
$cache =& $this->cache['PersonneACollection']; |
if (isset($cache[$id_personne])) { |
$donnees = $cache[$id_personne]; |
} else { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_COLLECTION."/*/*/$id_personne"; |
$this->addOrdre('cc_nom', self::ORDRE_ASCENDANT); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
$cache[$id_personne] = $donnees; |
} |
return $donnees; |
} |
|
/** |
* Retourne l'ensemble des structures liées à une personne. |
* |
* @param integer l'id de la personne. |
* @return array un tableau contenant les informations sur les structures liées à la personne. |
*/ |
public function getPersonneAStructure($id_personne) { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_STRUCTURE."/*/*/$id_personne"; |
$this->addOrdre('cs_nom', self::ORDRE_ASCENDANT); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
public function getStructuresLiees($id_personne) { |
$donnees = $this->getPersonneAStructure($id_personne); |
return $donnees['structuresAPersonne']; |
} |
|
/** |
* Retourne le nombre de structures liées à une personne. |
* |
* @param integer l'id de la personne. |
* @return integer le nombre de structures liées à la personne. |
*/ |
public function getNbreStructuresLiees($id_personne) { |
$donnees = $this->getPersonneAStructure($id_personne); |
return $donnees['nbElements']; |
} |
|
private function getPersonneAStructure($id_personne) { |
$cache =& $this->cache['PersonneAStructure']; |
if (isset($cache[$id_personne])) { |
$donnees = $cache[$id_personne]; |
} else { |
$url = $this->url_jrest.self::SERVICE_PERSONNE_A_STRUCTURE."/*/*/$id_personne"; |
$this->addOrdre('cp_nom', self::ORDRE_ASCENDANT); |
$json = $this->envoyerRequeteConsultation($url); |
$donnees = json_decode($json, true); |
$cache[$id_personne] = $donnees; |
} |
return $donnees; |
} |
|
/** |
* Retourne le nom complet d'une personne. |
* |
* @param integer l'id de la personne. |
* @return string le nom complet de la personne. |
*/ |
public function getPersonneNomComplet($id) { |
$nom_complet = ''; |
$donnees = $this->getPersonne($id); |
105,6 → 163,12 |
return $nom_complet; |
} |
|
/** |
* Retourne la chaine "truk" des courriels d'une personne. |
* |
* @param integer l'id de la personne. |
* @return string la chaine "truk" des courriels de la personne. |
*/ |
public function getPersonneCourriels($id) { |
$courriels = ''; |
$donnees = $this->getPersonne($id); |