Subversion Repositories Applications.referentiel

Rev

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

Rev 37 Rev 38
Line 21... Line 21...
21
	 * 
21
	 * 
22
	 * @return array un tableau contenant les informations sur les référentiels disponibles.
22
	 * @return array un tableau contenant les informations sur les référentiels disponibles.
23
	 */
23
	 */
24
	public function getReferentielsDispo() {
24
	public function getReferentielsDispo() {
25
		$url = $this->url_jrest.self::SERVICE."/Dispo";
25
		$url = $this->url_jrest.self::SERVICE."/Dispo";
26
		$json = file_get_contents($url);
26
		$json = $this->envoyerRequeteConsultation($url);
27
		$noms = json_decode($json, true);
27
		$noms = json_decode($json, true);
28
		return $noms;
28
		return $noms;
29
	}
29
	}
Line 30... Line 30...
30
	
30
	
31
	/**
31
	/**
32
	 * Retourne l'ensemble des information sur les colonnes d'une table.
32
	 * Retourne l'ensemble des information sur les noms d'un référentiel.
33
	 * 
33
	 * 
34
	 * @param string le nom de la table.
34
	 * @param string le code du référentiel.
35
	 * @return array un tableau contenant les informations sur les colonnes de la table.
35
	 * @return array un tableau contenant les informations sur les noms du référentiel.
36
	 */
36
	 */
37
	public function getTout($code_projet) {
37
	public function getTout($code_projet) {
-
 
38
		$url = $this->url_jrest.self::SERVICE."/Tout/$code_projet";
-
 
39
		$nbre = $this->getNombre($code_projet);
-
 
40
		$noms = array();
-
 
41
		$pas = 1000;
-
 
42
		for ($i = 0; $i < $nbre ; $i += $pas) {
38
		$url = $this->url_jrest.self::SERVICE."/Tout/$code_projet";
43
			$this->setLimitation($i, $pas);
39
		$json = file_get_contents($url);
44
			$json = $this->envoyerRequeteConsultation($url);
-
 
45
			$noms_partiel = json_decode($json, true);
-
 
46
			$noms = array_merge($noms, $noms_partiel);
40
		$noms = json_decode($json, true);
47
		}
41
		return $noms;
48
		return $noms;
Line 42... Line 49...
42
	}
49
	}
43
	
50
	
Line 47... Line 54...
47
	 * @param string le code du référentiel.
54
	 * @param string le code du référentiel.
48
	 * @return int le nombre de noms.
55
	 * @return int le nombre de noms.
49
	 */
56
	 */
50
	public function getNombre($code_projet) {
57
	public function getNombre($code_projet) {
51
		$url = $this->url_jrest.self::SERVICE."/Nombre/$code_projet";
58
		$url = $this->url_jrest.self::SERVICE."/Nombre/$code_projet";
52
		
-
 
53
		$json = file_get_contents($url);
59
		$json = $this->envoyerRequeteConsultation($url);
54
		$nbre = json_decode($json, true);
60
		$nbre = json_decode($json, true);
55
		
-
 
56
		return $nbre;
61
		return $nbre;
57
	}
62
	}
58
}
63
}
59
?>
64
?>
60
65