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