Subversion Repositories Applications.gtt

Rev

Go to most recent revision | Details | 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 ProjetTache
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 ProjetTache : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
45
* classe métier
46
*/
47
class ProjetTache extends aGttSql {
48
	/*** Constantes : */
49
	const GPT_ID = 'PROJETTACHE_ID';
50
	const GPT_ID_MAX = 'PROJETTACHE_ID_MAX';
51
 
52
	/*** Attributs : */
53
	private $id_tache;
54
	private $ce_tache_precedente;
55
	private $ce_projet;
56
	private $libelle;
57
	private $description;
58
	private $date_debut;
59
	private $duree_prevue;
60
	private $avancement;
61
 
62
	/*** Aggregations : */
63
 
64
	/*** Constructeur : */
65
	public function __construct($cmd = null, $parametres = null)
66
	{
67
		$this->dao_table_nom = 'gestion_projet_tache';
68
		$this->dao_correspondance = array(
69
			'gpt_id_tache'	=> 'id_tache',
70
			'gpt_ce_tache_precedente'	=> 'ce_tache_precedente',
71
			'gpt_ce_projet'	=> 'ce_projet',
72
			'gpt_libelle'	=> 'libelle',
73
			'gpt_description'	=> 'description',
74
			'gpt_date_debut'	=> 'date_debut',
75
			'gpt_duree_prevue'	=> 'duree_prevue',
76
			'gpt_avancement'	=> 'avancement');
77
 
78
		// Si l'on veut remplir l'objet à la création on lance la requete correspondante
79
		if (!is_null($cmd)) {
80
			$this->consulter($cmd, $parametres, true);
81
		}
82
	}
83
 
84
	/*** Accesseurs : */
85
	// Id Tache
86
	public function getIdTache()
87
	{
88
		return $this->id_tache;
89
	}
90
	public function setIdTache( $it )
91
	{
92
		$this->id_tache = $it;
93
	}
94
 
95
	// Ce Tache Precedente
96
	public function getCeTachePrecedente()
97
	{
98
		return $this->ce_tache_precedente;
99
	}
100
	public function setCeTachePrecedente( $ctp )
101
	{
102
		$this->ce_tache_precedente = $ctp;
103
	}
104
 
105
	// Ce Projet
106
	public function getCeProjet()
107
	{
108
		return $this->ce_projet;
109
	}
110
	public function setCeProjet( $cp )
111
	{
112
		$this->ce_projet = $cp;
113
	}
114
 
115
	// Libelle
116
	public function getLibelle()
117
	{
118
		return $this->libelle;
119
	}
120
	public function setLibelle( $l )
121
	{
122
		$this->libelle = $l;
123
	}
124
 
125
	// Description
126
	public function getDescription()
127
	{
128
		return $this->description;
129
	}
130
	public function setDescription( $d )
131
	{
132
		$this->description = $d;
133
	}
134
 
135
	// Date Debut
136
	public function getDateDebut()
137
	{
138
		return $this->date_debut;
139
	}
140
	public function setDateDebut( $dd )
141
	{
142
		$this->date_debut = $dd;
143
	}
144
 
145
	// Duree Prevue
146
	public function getDureePrevue()
147
	{
148
		return $this->duree_prevue;
149
	}
150
	public function setDureePrevue( $dp )
151
	{
152
		$this->duree_prevue = $dp;
153
	}
154
 
155
	// Avancement
156
	public function getAvancement()
157
	{
158
		return $this->avancement;
159
	}
160
	public function setAvancement( $a )
161
	{
162
		$this->avancement = $a;
163
	}
164
 
165
	/*** Méthodes : */
166
 
167
	/**
168
	* Consulter la table gestion_projet_tache.
169
	* @return mixed un tableau d'objets ProjetTache s'il y en a plusieurs, l'objet ProjetTache s'il y en a 1 seul sinon false.
170
	*/
171
	public function consulter($cmd = '', $parametres = array(), $instancier = false)
172
	{
173
		switch ($cmd) {
174
			case ProjetTache::GPT_ID:
175
				$requete = 	'SELECT * '.
176
							'FROM gestion_projet_tache '.
177
							'WHERE gpt_id_tache = '.$parametres[0].' ';
178
				break;
179
			case ProjetTache::GPT_ID_MAX:
180
				$requete =	'SELECT MAX(gpt_id_tache) '.
181
							'FROM gestion_projet_tache ';
182
				break;
183
			default :
184
				$message = 'Commande '.$cmd.'inconnue!';
185
				$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
186
    			trigger_error($e, E_USER_ERROR);
187
		}
188
 
189
		$resultat = $GLOBALS['db']->query($requete);
190
		(DB::isError($resultat)) ? die (GestionnaireErreur::retournerErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
191
		$tab_resultat = array();
192
		while ($donnees =& $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
193
			$tab_resultat[] = $this->basculerEnregistrementObjet($donnees, $instancier);
194
		}
195
 
196
		$resultat_nbre = count($tab_resultat);
197
		if ($resultat_nbre > 1) {
198
			return $tab_resultat;
199
		} else if ($resultat_nbre == 1) {
200
			return $tab_resultat[0];
201
		} else if ($resultat_nbre == 0) {
202
			return false;
203
		}
204
	}
205
 
206
	/** Afficher l'objet ProjetTache */
207
	function afficherProjetTache()
208
	{
209
		echo '<pre>'.print_r($this, true).'</pre>';
210
	}
211
}
212
 
213
/* +--Fin du code ----------------------------------------------------------------------------------------+
214
*
215
* $Log$
216
*
217
* +-- Fin du code ----------------------------------------------------------------------------------------+
218
*/
219
?>