78,13 → 78,9 |
} |
|
private function analyserRessources() { |
if ($this->methode == 'consulter' && isset($this->ressources[0])) { |
if (preg_match('/^tags|votes-?-Par-?Tag|tags-?Par-?Protocole$/i', $this->ressources[0])) { |
$this->sousServiceNom = 'tags'; |
} else if (preg_match('/^votes|votes-?Par-?Protocole$/i', $this->ressources[0])){ |
$this->sousServiceNom = 'votes'; |
} else if ($this->ressources[0] == 'commentaires') { |
$this->sousServiceNom = 'commentaires'; |
if ($this->methode == 'consulter') { |
if (isset($this->ressources[0])) { |
$this->sousServiceNom = $this->ressources[0]; |
} |
} |
if ($this->sousServiceNom == null) { |
113,7 → 109,7 |
} |
|
private function initialiserService() { |
$classe = $this->obtenirNomClasseService(); |
$classe = $this->obtenirNomClasseService($this->sousServiceNom); |
$chemins = array(); |
$chemins[] = $this->cheminCourant.$this->serviceNom.DS.$classe.'.php'; |
$chemins[] = $this->cheminCourant.'commun'.DS.$classe.'.php'; |
146,8 → 142,9 |
return $retour; |
} |
|
private function obtenirNomClasseService() { |
return str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $this->sousServiceNom)))); |
private function obtenirNomClasseService($mot) { |
$classeNom = str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $mot)))); |
return $classeNom; |
} |
|
private function creerResultatService($donnees) { |