Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 390 Rev 391
Line 27... Line 27...
27
	protected $table="";
27
	protected $table="";
28
	private $requete_condition = "";
28
	private $requete_condition = "";
29
	/** Permet de stocker la requete formulée:  /informations/bdnt.nn |  */
29
	/** Permet de stocker la requete formulée:  /informations/bdnt.nn |  */
30
	private $format_reponse = 'informations';
30
	private $format_reponse = 'informations';
31
	private $total_resultat;
31
	private $total_resultat;
32
	private $limite_requete = array( 'depart' => 0, 'limite' => 10);
32
	protected $limite_requete = array( 'depart' => 0, 'limite' => 10);
33
	private $champs_recherches='*';
33
	private $champs_recherches='*';
Line 34... Line 34...
34
	
34
	
35
	
35
	
Line 93... Line 93...
93
	public function retournerResultatFormate($resultat) {
93
	public function retournerResultatFormate($resultat) {
94
		if ((count($this->ressources)) == 0){
94
		if ((count($this->ressources)) == 0){
95
			$table_retour_json=array();
95
			$table_retour_json=array();
96
			$table_retour_json['entete'] = $this->ajouterEnteteResultat();
96
			$table_retour_json['entete'] = $this->ajouterEnteteResultat();
97
			$table_retour_json['resultat'] = $this->formaterResultats($resultat);
97
			$table_retour_json['resultat'] = $this->formaterResultats($resultat);
-
 
98
			
98
		} else {
99
		} else {
99
			$table_retour_json = $resultat[0];
100
			$table_retour_json = $resultat[0];
100
		}
101
		}
101
		return $table_retour_json;
102
		return $table_retour_json;
102
	}
103
	}
Line 106... Line 107...
106
			$num = $tab['cle'];
107
			$num = $tab['cle'];
107
			unset($tab['cle']);
108
			unset($tab['cle']);
108
			foreach ($tab as $param => $valeur) {
109
			foreach ($tab as $param => $valeur) {
109
				$resultat_json[$num][$param] = $valeur;
110
				$resultat_json[$num][$param] = $valeur;
110
			}
111
			}
-
 
112
			$resultat_json[$num]['href'] = $this->ajouterHref('ontologies', $num);
111
		}
113
		}
112
		return $resultat_json;
114
		return $resultat_json;
113
	}
115
	}
114
	public function ajouterEnteteResultat() {
116
	public function ajouterEnteteResultat() {
Line 115... Line 117...
115
		
117
		
116
		$entete['depart'] = $this->limite_requete['depart'];
118
		$entete['depart'] = $this->limite_requete['depart'];
117
		$entete['limite'] = $this->limite_requete['limite'];
119
		$entete['limite'] = $this->limite_requete['limite'];
118
		$entete['total']  =  $this->total_resultat;
120
		$entete['total']  =  $this->total_resultat;
-
 
121
		$entete['version']  = $this->version_projet;
-
 
122
		$url = $this->formulerUrl($this->total_resultat, '/informations');
-
 
123
		if (isset($url['precedent']) && $url['precedent'] != '') {
-
 
124
			$entete['href.precedent'] = $url['precedent'];
-
 
125
		}
-
 
126
		if (isset($url['suivant']) && $url['suivant'] != '') {
-
 
127
			$entete['href.suivant']   = $url['suivant'];
Line 119... Line 128...
119
		$entete['version']  = $this->version_projet;
128
		}
120
		
129