Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1837 Rev 1838
Line 17... Line 17...
17
 */
17
 */
Line 18... Line 18...
18
 
18
 
Line 19... Line 19...
19
class ConsulterCommentaire {
19
class ConsulterCommentaire {
20
 
-
 
21
	private $conteneur;
20
 
22
	private $navigation;
21
	private $conteneur;
Line 23... Line 22...
23
	private $bdd;
22
	private $bdd;
24
	private $idCommentaire;
-
 
Line 25... Line 23...
25
 
23
	private $idCommentaire;
26
	private $mapping = array();
24
 
27
	private $mappingInverse = array();
-
 
28
 
25
	private $mapping = array();
Line 29... Line 26...
29
	public function __construct(Conteneur $conteneur = null) {
26
 
30
		$this->conteneur = $conteneur == null ? new Conteneur() : $conteneur;
-
 
31
		$this->navigation = $conteneur->getNavigation();
27
	public function __construct(Conteneur $conteneur = null) {
Line 32... Line 28...
32
		$this->bdd = $this->conteneur->getBdd();
28
		$this->conteneur = $conteneur == null ? new Conteneur() : $conteneur;
33
 
29
		$this->bdd = $this->conteneur->getBdd();
Line 34... Line 30...
34
		$this->mapping = $this->conteneur->getParametreTableau('commentaires.mapping');
30
 
35
		$this->mappingInverse = array_flip($this->mapping);
31
		$this->mapping = $this->conteneur->getParametreTableau('commentaires.mapping');
36
	}
32
	}
37
 
-
 
Line 38... Line 33...
38
	public function consulter($ressources) {
33
 
39
		$this->idCommentaire = $ressources[0];
34
	public function consulter($ressources) {
40
 
35
		$this->idCommentaire = $ressources[0];
Line 52... Line 47...
52
 
47
 
53
	private function chargerCommentaire() {
48
	private function chargerCommentaire() {
54
		$requete = 'SELECT * '.
49
		$requete = 'SELECT * '.
55
			'FROM del_commentaire '.
50
			'FROM del_commentaire '.
56
			'WHERE id_commentaire = '.$this->idCommentaire.' '.
-
 
57
			'LIMIT '.$this->navigation->getDepart().', '.$this->navigation->getLimite().' '.
51
			'WHERE id_commentaire = '.$this->idCommentaire.' '.
58
			' -- '.__FILE__.' : '.__LINE__;
52
			' -- '.__FILE__.' : '.__LINE__;
59
		$resultat = $this->bdd->recuperer($requete);
53
		$resultat = $this->bdd->recuperer($requete);
60
		if ($resultat === false) {
54
		if ($resultat === false) {
61
			$message = "Aucune information ne correspond au commentaire # «{$this->idCommentaire}».";
55
			$message = "Aucune information ne correspond au commentaire # «{$this->idCommentaire}».";