10 |
jpm |
1 |
<?php
|
170 |
mathias |
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 |
// +------------------------------------------------------------------------------------------------------+
|
10 |
jpm |
23 |
// CVS : $Id$
|
170 |
mathias |
24 |
/**
|
10 |
jpm |
25 |
* Classe AbsenceMotif
|
170 |
mathias |
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
|
10 |
jpm |
39 |
*@version $Revision$ $Date$
|
170 |
mathias |
40 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
41 |
*/
|
|
|
42 |
|
|
|
43 |
/**
|
|
|
44 |
* class AbsenceMotif : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
|
|
|
45 |
* classe métier
|
|
|
46 |
*/
|
|
|
47 |
class AbsenceMotif extends aGttSql {
|
|
|
48 |
/*** Constantes : */
|
32 |
jpm |
49 |
const GAM_TOUS = 'ABSENCEMOTIF_TOUS';
|
170 |
mathias |
50 |
const GAM_ID = 'ABSENCEMOTIF_ID';
|
|
|
51 |
const GAM_ID_MAX = 'ABSENCEMOTIF_ID_MAX';
|
48 |
jpm |
52 |
const GAM_LIBELLE = 'ABSENCEMOTIF_LIBELLE';
|
170 |
mathias |
53 |
|
|
|
54 |
/*** Attributs : */
|
|
|
55 |
private $id_absence_motif;
|
82 |
jpm |
56 |
private $libelle;
|
87 |
jpm |
57 |
private $mark_cp_diminuer;
|
|
|
58 |
private $mark_hs_diminuer;
|
170 |
mathias |
59 |
|
|
|
60 |
/*** Aggregations : */
|
|
|
61 |
|
|
|
62 |
/*** Constructeur : */
|
|
|
63 |
public function __construct($cmd = null, $parametres = null)
|
|
|
64 |
{
|
|
|
65 |
$this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_absence_motif';
|
|
|
66 |
$this->dao_correspondance = array(
|
10 |
jpm |
67 |
'gam_id_absence_motif' => 'id_absence_motif',
|
82 |
jpm |
68 |
'gam_libelle' => 'libelle',
|
87 |
jpm |
69 |
'gam_mark_cp_diminuer' => 'mark_cp_diminuer',
|
|
|
70 |
'gam_mark_hs_diminuer' => 'mark_hs_diminuer');
|
170 |
mathias |
71 |
|
|
|
72 |
// Si l'on veut remplir l'objet à la création on lance la requete correspondante
|
|
|
73 |
if (!is_null($cmd)) {
|
|
|
74 |
$this->consulter($cmd, $parametres, true);
|
|
|
75 |
}
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
/*** Accesseurs : */
|
10 |
jpm |
79 |
// Id Absence Motif
|
170 |
mathias |
80 |
public function getIdAbsenceMotif()
|
|
|
81 |
{
|
|
|
82 |
return $this->id_absence_motif;
|
|
|
83 |
}
|
|
|
84 |
public function setIdAbsenceMotif( $iam )
|
|
|
85 |
{
|
|
|
86 |
$this->id_absence_motif = $iam;
|
|
|
87 |
}
|
|
|
88 |
|
10 |
jpm |
89 |
// Libelle
|
170 |
mathias |
90 |
public function getLibelle()
|
|
|
91 |
{
|
|
|
92 |
return $this->libelle;
|
|
|
93 |
}
|
|
|
94 |
public function setLibelle( $l )
|
|
|
95 |
{
|
|
|
96 |
$this->libelle = $l;
|
|
|
97 |
}
|
82 |
jpm |
98 |
|
|
|
99 |
// CP Diminuer
|
87 |
jpm |
100 |
public function getMarkCpDiminuer()
|
82 |
jpm |
101 |
{
|
87 |
jpm |
102 |
return $this->mark_cp_diminuer;
|
82 |
jpm |
103 |
}
|
87 |
jpm |
104 |
public function setMarkCpDiminuer( $cd )
|
82 |
jpm |
105 |
{
|
87 |
jpm |
106 |
$this->mark_cp_diminuer = $cd;
|
82 |
jpm |
107 |
}
|
|
|
108 |
|
|
|
109 |
// HS Diminuer
|
87 |
jpm |
110 |
public function getMarkHsDiminuer()
|
82 |
jpm |
111 |
{
|
87 |
jpm |
112 |
return $this->mark_hs_diminuer;
|
82 |
jpm |
113 |
}
|
87 |
jpm |
114 |
public function setMarkHsDiminuer( $hd )
|
82 |
jpm |
115 |
{
|
87 |
jpm |
116 |
$this->mark_hs_diminuer = $hd;
|
82 |
jpm |
117 |
}
|
|
|
118 |
|
170 |
mathias |
119 |
/*** Méthodes : */
|
|
|
120 |
|
|
|
121 |
/**
|
|
|
122 |
* Consulter la table gestion_absence_motif.
|
|
|
123 |
* @return mixed un tableau d'objets AbsenceMotif s'il y en a plusieurs, l'objet AbsenceMotif s'il y en a 1 seul sinon false.
|
|
|
124 |
*/
|
|
|
125 |
public function consulter($cmd = '', $parametres = array(), $instancier = false)
|
|
|
126 |
{
|
32 |
jpm |
127 |
switch ($cmd) {
|
|
|
128 |
case AbsenceMotif::GAM_TOUS:
|
|
|
129 |
$requete = 'SELECT * '.
|
170 |
mathias |
130 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif ';
|
48 |
jpm |
131 |
break;
|
170 |
mathias |
132 |
case AbsenceMotif::GAM_ID:
|
|
|
133 |
$requete = 'SELECT * '.
|
|
|
134 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif '.
|
|
|
135 |
'WHERE gam_id_absence_motif = #0 ';
|
|
|
136 |
break;
|
|
|
137 |
case AbsenceMotif::GAM_ID_MAX:
|
|
|
138 |
$requete = 'SELECT MAX(gam_id_absence_motif) AS gam_id_absence_motif '.
|
|
|
139 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif ';
|
|
|
140 |
break;
|
48 |
jpm |
141 |
case AbsenceMotif::GAM_LIBELLE:
|
|
|
142 |
$requete = 'SELECT * '.
|
170 |
mathias |
143 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif '.
|
87 |
jpm |
144 |
'WHERE gam_libelle = "#0" ';
|
170 |
mathias |
145 |
break;
|
|
|
146 |
default :
|
|
|
147 |
$message = 'Commande '.$cmd.'inconnue!';
|
|
|
148 |
$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
|
|
|
149 |
trigger_error($e, E_USER_ERROR);
|
|
|
150 |
}
|
|
|
151 |
return parent::consulter($requete, $parametres, $instancier);
|
|
|
152 |
}
|
|
|
153 |
}
|
|
|
154 |
|
|
|
155 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
156 |
*
|
10 |
jpm |
157 |
* $Log$
|
170 |
mathias |
158 |
*
|
|
|
159 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
160 |
*/
|
10 |
jpm |
161 |
?>
|