Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1635 → Rev 1636

/trunk/jrest/services/CoelCollection.php
59,7 → 59,7
$info = array();
// Pré traitement des paramêtres
$p = $this->traiterParametresUrl(array('id_projet', 'id_collection', 'nom'), $param);
$p = $this->traiterParametresUrl(array('id_projet', 'id_collection', 'recherche'), $param);
// Construction de la requête
$requete = (($this->distinct) ? 'SELECT DISTINCT' : 'SELECT').' c.*, cb.*, '.
74,7 → 74,7
((count($p) != 0) ? 'WHERE ' : '').
((isset($p['id_projet'])) ? "AND c.cc_ce_projet = {$p['id_projet']} " : '').
((isset($p['id_collection'])) ? "AND c.cc_id_collection = {$p['id_collection']} " : '').
((isset($p['nom'])) ? "AND c.cc_nom LIKE {$p['nom']} " : '').
(isset($p['recherche']) ? $this->construireWhereRecherche($p['recherche']) : '').
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'c.cc_nom ASC').' ';
$requete = str_replace('WHERE AND', 'WHERE', $requete);
102,6 → 102,15
return $info;
}
private function construireWhereRecherche($recherche) {
$recherche = "AND ".
"(".
"c.cc_nom LIKE {$recherche} OR ".
"cs_ville LIKE {$recherche} ".
")";
return $recherche;
}
/* Méthode pour récupérer une liste de collection en fonction d'un id structure.
* Appelée avec les paramêtres d'url suivant :
* /CoelCollection/ParIdStructure/_