Subversion Repositories Applications.gtt

Rev

Rev 104 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 104 Rev 170
1
<?php
1
<?php
2
// +------------------------------------------------------------------------------------------------------+
2
// +------------------------------------------------------------------------------------------------------+
3
// | PHP version 5.1.1                                                                                    |
3
// | PHP version 5.1.1                                                                                    |
4
// +------------------------------------------------------------------------------------------------------+
4
// +------------------------------------------------------------------------------------------------------+
5
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
5
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// +------------------------------------------------------------------------------------------------------+
6
// +------------------------------------------------------------------------------------------------------+
7
// | This file is part of eFlore.                                                                         |
7
// | This file is part of eFlore.                                                                         |
8
// |                                                                                                      |
8
// |                                                                                                      |
9
// | Foobar is free software; you can redistribute it and/or modify                                       |
9
// | Foobar is free software; you can redistribute it and/or modify                                       |
10
// | it under the terms of the GNU General Public License as published by                                 |
10
// | it under the terms of the GNU General Public License as published by                                 |
11
// | the Free Software Foundation; either version 2 of the License, or                                    |
11
// | the Free Software Foundation; either version 2 of the License, or                                    |
12
// | (at your option) any later version.                                                                  |
12
// | (at your option) any later version.                                                                  |
13
// |                                                                                                      |
13
// |                                                                                                      |
14
// | Foobar is distributed in the hope that it will be useful,                                            |
14
// | Foobar is distributed in the hope that it will be useful,                                            |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
16
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
17
// | GNU General Public License for more details.                                                         |
17
// | GNU General Public License for more details.                                                         |
18
// |                                                                                                      |
18
// |                                                                                                      |
19
// | You should have received a copy of the GNU General Public License                                    |
19
// | You should have received a copy of the GNU General Public License                                    |
20
// | along with Foobar; if not, write to the Free Software                                                |
20
// | along with Foobar; if not, write to the Free Software                                                |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
22
// +------------------------------------------------------------------------------------------------------+
22
// +------------------------------------------------------------------------------------------------------+
23
// CVS : $Id$
23
// CVS : $Id$
24
/**
24
/**
25
* Classe FraisKmTaux
25
* Classe FraisKmTaux
26
*
26
*
27
* Description
27
* Description
28
*
28
*
29
*@package eFlore
29
*@package eFlore
30
*@subpackage modele
30
*@subpackage modele
31
//Auteur original :
31
//Auteur original :
32
*@version 3
32
*@version 3
33
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
33
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
34
//Autres auteurs :
34
//Autres auteurs :
35
*@version 4
35
*@version 4
36
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
36
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
37
*@author        aucun
37
*@author        aucun
38
*@copyright     Tela-Botanica 2000-2006
38
*@copyright     Tela-Botanica 2000-2006
39
*@version       $Revision$ $Date$
39
*@version       $Revision$ $Date$
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
*/
41
*/
42
 
42
 
43
/**
43
/**
44
* class FraisKmTaux : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
44
* class FraisKmTaux : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
45
* classe métier
45
* classe métier
46
*/
46
*/
47
class FraisKmTaux extends aGttSql {
47
class FraisKmTaux extends aGttSql {
48
	/*** Constantes : */
48
	/*** Constantes : */
49
	const GFKT_ID = 'FRAISKMTAUX_ID';
49
	const GFKT_ID = 'FRAISKMTAUX_ID';
50
	const GFKT_ID_MAX = 'FRAISKMTAUX_ID_MAX';
50
	const GFKT_ID_MAX = 'FRAISKMTAUX_ID_MAX';
51
 
51
 
52
	/*** Attributs : */
52
	/*** Attributs : */
53
	private $id_frais_km_taux;
53
	private $id_frais_km_taux;
54
	private $taux;
54
	private $taux;
55
 
55
 
56
	/*** Aggregations : */
56
	/*** Aggregations : */
57
 
57
 
58
	/*** Constructeur : */
58
	/*** Constructeur : */
59
	public function __construct($cmd = null, $parametres = null)
59
	public function __construct($cmd = null, $parametres = null)
60
	{
60
	{
61
		$this->dao_table_nom = 'gestion_frais_km_taux';
61
		$this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_frais_km_taux';
62
		$this->dao_correspondance = array(
62
		$this->dao_correspondance = array(
63
			'gfkt_id_frais_km_taux'	=> 'id_frais_km_taux',
63
			'gfkt_id_frais_km_taux'	=> 'id_frais_km_taux',
64
			'gfkt_taux'	=> 'taux');
64
			'gfkt_taux'	=> 'taux');
65
 
65
 
66
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
66
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
67
		if (!is_null($cmd)) {
67
		if (!is_null($cmd)) {
68
			$this->consulter($cmd, $parametres, true);
68
			$this->consulter($cmd, $parametres, true);
69
		}
69
		}
70
	}
70
	}
71
 
71
 
72
	/*** Accesseurs : */
72
	/*** Accesseurs : */
73
	// Id Frais Km Taux
73
	// Id Frais Km Taux
74
	public function getIdFraisKmTaux()
74
	public function getIdFraisKmTaux()
75
	{
75
	{
76
		return $this->id_frais_km_taux;
76
		return $this->id_frais_km_taux;
77
	}
77
	}
78
	public function setIdFraisKmTaux( $ifkt )
78
	public function setIdFraisKmTaux( $ifkt )
79
	{
79
	{
80
		$this->id_frais_km_taux = $ifkt;
80
		$this->id_frais_km_taux = $ifkt;
81
	}
81
	}
82
 
82
 
83
	// Taux
83
	// Taux
84
	public function getTaux()
84
	public function getTaux()
85
	{
85
	{
86
		return $this->taux;
86
		return $this->taux;
87
	}
87
	}
88
	public function setTaux( $t )
88
	public function setTaux( $t )
89
	{
89
	{
90
		$this->taux = $t;
90
		$this->taux = $t;
91
	}
91
	}
92
 
92
 
93
	/*** Méthodes : */
93
	/*** Méthodes : */
94
 
94
 
95
	/**
95
	/**
96
	* Consulter la table gestion_frais_km_taux.
96
	* Consulter la table gestion_frais_km_taux.
97
	* @return mixed un tableau d'objets FraisKmTaux s'il y en a plusieurs, l'objet FraisKmTaux s'il y en a 1 seul sinon false.
97
	* @return mixed un tableau d'objets FraisKmTaux s'il y en a plusieurs, l'objet FraisKmTaux s'il y en a 1 seul sinon false.
98
	*/
98
	*/
99
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
99
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
100
	{
100
	{
101
		switch ($cmd) {
101
		switch ($cmd) {
102
			case FraisKmTaux::GFKT_ID:
102
			case FraisKmTaux::GFKT_ID:
103
				$requete = 	'SELECT * '.
103
				$requete = 	'SELECT * '.
104
							'FROM gestion_frais_km_taux '.
104
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_frais_km_taux '.
105
							'WHERE gfkt_id_frais_km_taux = #0 ';
105
							'WHERE gfkt_id_frais_km_taux = #0 ';
106
				break;
106
				break;
107
			case FraisKmTaux::GFKT_ID_MAX:
107
			case FraisKmTaux::GFKT_ID_MAX:
108
				$requete =	'SELECT MAX(gfkt_id_frais_km_taux) '.
108
				$requete =	'SELECT MAX(gfkt_id_frais_km_taux) '.
109
							'FROM gestion_frais_km_taux ';
109
							'FROM ' . GTT_BDD_PREFIXE . 'gestion_frais_km_taux ';
110
				break;
110
				break;
111
			default :
111
			default :
112
				$message = 'Commande '.$cmd.'inconnue!';
112
				$message = 'Commande '.$cmd.'inconnue!';
113
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
113
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
114
    			trigger_error($e, E_USER_ERROR);
114
    			trigger_error($e, E_USER_ERROR);
115
		}
115
		}
116
		return parent::consulter($requete, $parametres, $instancier);
116
		return parent::consulter($requete, $parametres, $instancier);
117
	}
117
	}
118
}
118
}
119
 
119
 
120
/* +--Fin du code ----------------------------------------------------------------------------------------+
120
/* +--Fin du code ----------------------------------------------------------------------------------------+
121
*
121
*
122
* $Log$
122
* $Log$
123
*
123
*
124
* +-- Fin du code ----------------------------------------------------------------------------------------+
124
* +-- Fin du code ----------------------------------------------------------------------------------------+
125
*/
125
*/
126
?>
126
?>
127
127