Subversion Repositories Applications.gtt

Rev

Rev 82 | Rev 89 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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 AbsenceMotif
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
/**
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';
10 jpm 50
	const GAM_ID = 'ABSENCEMOTIF_ID';
51
	const GAM_ID_MAX = 'ABSENCEMOTIF_ID_MAX';
48 jpm 52
	const GAM_LIBELLE = 'ABSENCEMOTIF_LIBELLE';
32 jpm 53
 
10 jpm 54
	/*** Attributs : */
55
	private $id_absence_motif;
82 jpm 56
	private $libelle;
87 jpm 57
	private $mark_cp_diminuer;
58
	private $mark_hs_augmenter;
59
	private $mark_hs_diminuer;
82 jpm 60
 
10 jpm 61
	/*** Aggregations : */
62
 
63
	/*** Constructeur : */
64
	public function __construct($cmd = null, $parametres = null)
65
	{
66
		$this->dao_table_nom = 'gestion_absence_motif';
67
		$this->dao_correspondance = array(
68
			'gam_id_absence_motif'	=> 'id_absence_motif',
82 jpm 69
			'gam_libelle'	=> 'libelle',
87 jpm 70
			'gam_mark_cp_diminuer'	=> 'mark_cp_diminuer',
71
			'gam_mark_hs_augmenter'	=> 'mark_hs_augmenter',
72
			'gam_mark_hs_diminuer'	=> 'mark_hs_diminuer');
32 jpm 73
 
10 jpm 74
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
75
		if (!is_null($cmd)) {
76
			$this->consulter($cmd, $parametres, true);
77
		}
78
	}
32 jpm 79
 
10 jpm 80
	/*** Accesseurs : */
81
	// Id Absence Motif
82
	public function getIdAbsenceMotif()
83
	{
84
		return $this->id_absence_motif;
85
	}
86
	public function setIdAbsenceMotif( $iam )
87
	{
88
		$this->id_absence_motif = $iam;
89
	}
32 jpm 90
 
10 jpm 91
	// Libelle
92
	public function getLibelle()
93
	{
94
		return $this->libelle;
95
	}
96
	public function setLibelle( $l )
97
	{
98
		$this->libelle = $l;
99
	}
82 jpm 100
 
101
	// CP Diminuer
87 jpm 102
	public function getMarkCpDiminuer()
82 jpm 103
	{
87 jpm 104
		return $this->mark_cp_diminuer;
82 jpm 105
	}
87 jpm 106
	public function setMarkCpDiminuer( $cd )
82 jpm 107
	{
87 jpm 108
		$this->mark_cp_diminuer = $cd;
82 jpm 109
	}
110
 
111
	// HS Augmenter
87 jpm 112
	public function getMarkHsAugmenter()
82 jpm 113
	{
87 jpm 114
		return $this->mark_hs_augmenter;
82 jpm 115
	}
87 jpm 116
	public function setMarkHsAugmenter( $ha )
82 jpm 117
	{
87 jpm 118
		$this->mark_hs_augmenter = $ha;
82 jpm 119
	}
120
 
121
	// HS Diminuer
87 jpm 122
	public function getMarkHsDiminuer()
82 jpm 123
	{
87 jpm 124
		return $this->mark_hs_diminuer;
82 jpm 125
	}
87 jpm 126
	public function setMarkHsDiminuer( $hd )
82 jpm 127
	{
87 jpm 128
		$this->mark_hs_diminuer = $hd;
82 jpm 129
	}
130
 
10 jpm 131
	/*** Méthodes : */
132
 
133
	/**
134
	* Consulter la table gestion_absence_motif.
135
	* @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.
136
	*/
137
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
138
	{
32 jpm 139
		switch ($cmd) {
140
			case AbsenceMotif::GAM_TOUS:
141
				$requete = 	'SELECT * '.
142
							'FROM gestion_absence_motif ';
143
				break;
10 jpm 144
			case AbsenceMotif::GAM_ID:
145
				$requete = 	'SELECT * '.
146
							'FROM gestion_absence_motif '.
87 jpm 147
							'WHERE gam_id_absence_motif = #0 ';
10 jpm 148
				break;
149
			case AbsenceMotif::GAM_ID_MAX:
48 jpm 150
				$requete =	'SELECT MAX(gam_id_absence_motif) as gam_id_absence_motif '.
10 jpm 151
							'FROM gestion_absence_motif ';
48 jpm 152
				break;
153
			case AbsenceMotif::GAM_LIBELLE:
154
				$requete =	'SELECT * '.
155
							'FROM gestion_absence_motif '.
87 jpm 156
							'WHERE gam_libelle = "#0" ';
10 jpm 157
				break;
158
			default :
159
				$message = 'Commande '.$cmd.'inconnue!';
160
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
161
    			trigger_error($e, E_USER_ERROR);
162
		}
87 jpm 163
		return parent::consulter($requete, $parametres, $instancier);
10 jpm 164
	}
32 jpm 165
 
10 jpm 166
	/** Afficher l'objet AbsenceMotif */
167
	function afficherAbsenceMotif()
168
	{
169
		echo '<pre>'.print_r($this, true).'</pre>';
170
	}
171
}
172
 
173
/* +--Fin du code ----------------------------------------------------------------------------------------+
174
*
175
* $Log$
176
*
177
* +-- Fin du code ----------------------------------------------------------------------------------------+
178
*/
179
?>