Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 18 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 19
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
* Classe modèle spécifique à l'application Collection, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
4
* Classe modèle spécifique à l'application Collection, donc d'accés au données, elle ne devrait pas être appelée de l'extérieur.
5
* Elle est abstraite donc doit obligatoirement être étendue.
5
* Elle est abstraite donc doit obligatoirement être étendue.
6
*
6
*
7
* @category  php5
7
* @category  php5
8
* @package   Collection
8
* @package   Collection
9
* @author	Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
* @author	Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
* @copyright 2010 Tela-Botanica
10
* @copyright 2010 Tela-Botanica
11
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
* @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
12
* @license   http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
* @license   http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
13
* @version   SVN: $Id: ColModele.php 18 2010-03-23 18:14:32Z jpm $
13
* @version   SVN: $Id: ColModele.php 19 2010-03-24 18:22:25Z jpm $
14
*/
14
*/
15
abstract class ColModele extends Modele {
15
abstract class ColModele extends Modele {
16
	protected $limite_debut = null;
16
	protected $limite_debut = null;
17
	protected $limite_nbre = null;
17
	protected $limite_nbre = null;
-
 
18
	protected $url_jrest = null;
-
 
19
	
-
 
20
	public function __construct() {
-
 
21
		parent::__construct();
-
 
22
		$this->url_jrest = config::get('url_jrest');
-
 
23
	}
18
	
24
	
19
	public function avoirLimitation() {
25
	public function avoirLimitation() {
20
		$limitation = false;
26
		$limitation = false;
21
		if (!is_null($this->limite_debut) && !is_null($this->limite_nbre)) {
27
		if (!is_null($this->limite_debut) && !is_null($this->limite_nbre)) {
22
			$limitation = true;
28
			$limitation = true;
23
		}
29
		}
24
		return $limitation;
30
		return $limitation;
25
	}
31
	}
26
	
32
	
27
	public function setLimitation($limite_debut, $limite_nbre) {
33
	public function setLimitation($limite_debut, $limite_nbre) {
28
		$this->limite_debut = $limite_debut;
34
		$this->limite_debut = $limite_debut;
29
		$this->limite_nbre = $limite_nbre;
35
		$this->limite_nbre = $limite_nbre;
30
	}
36
	}
31
	
37
	
32
	public function getLimiteDebut() {
38
	public function getLimiteDebut() {
33
		return $this->limite_debut;
39
		return $this->limite_debut;
34
	}
40
	}
35
	public function getLimiteNbre() {
41
	public function getLimiteNbre() {
36
		return $this->limite_nbre;
42
		return $this->limite_nbre;
37
	}
43
	}
38
	
44
	
39
	protected function nettoyerTableauDeTableauxAssoc(&$tableau) {
45
	protected function nettoyerTableauDeTableauxAssoc(&$tableau) {
40
		if (is_array($tableau) && count($tableau) > 0) {
46
		if (is_array($tableau) && count($tableau) > 0) {
41
			foreach ($tableau as $cle => $valeur) {
47
			foreach ($tableau as $cle => $valeur) {
42
				$this->nettoyerTableauAssoc($valeur);
48
				$this->nettoyerTableauAssoc($valeur);
43
				$tableau[$cle] = $valeur;
49
				$tableau[$cle] = $valeur;
44
			}
50
			}
45
		}
51
		}
46
	}
52
	}
47
	
53
	
48
	protected function nettoyerTableauAssoc(&$tableau) {
54
	protected function nettoyerTableauAssoc(&$tableau) {
49
		if (is_array($tableau) && count($tableau) > 0) {
55
		if (is_array($tableau) && count($tableau) > 0) {
50
			foreach ($tableau as $cle => $valeur) {
56
			foreach ($tableau as $cle => $valeur) {
51
				if (is_numeric($cle) && is_int((integer) $cle)) {
57
				if (is_numeric($cle) && is_int((integer) $cle)) {
52
					unset($tableau[$cle]);
58
					unset($tableau[$cle]);
53
				}
59
				}
54
			}
60
			}
55
		}
61
		}
56
	}
62
	}
57
}
63
}