| Line 1... |
Line 1... |
| 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 UtilisateurAProjet
|
25 |
* Classe UtilisateurAProjet
|
| 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 UtilisateurAProjet : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
|
44 |
* class UtilisateurAProjet : 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 UtilisateurAProjet extends aGttSql {
|
47 |
class UtilisateurAProjet extends aGttSql {
|
| 48 |
/*** Constantes : */
|
48 |
/*** Constantes : */
|
| 49 |
const GUAP_ID = 'UTILISATEURAPROJET_ID';
|
49 |
const GUAP_ID = 'UTILISATEURAPROJET_ID';
|
| 50 |
const GUAP_ID_MAX_UTILISATEUR = 'UTILISATEURAPROJET_ID_MAX_UTILISATEUR';
|
50 |
const GUAP_ID_MAX_UTILISATEUR = 'UTILISATEURAPROJET_ID_MAX_UTILISATEUR';
|
| 51 |
const GUAP_ID_MAX_PROJET = 'UTILISATEURAPROJET_ID_MAX_PROJET';
|
51 |
const GUAP_ID_MAX_PROJET = 'UTILISATEURAPROJET_ID_MAX_PROJET';
|
| 52 |
const GUAP_UTILISATEUR = 'UTILISATEURAPROJET_ID_UTILISATEUR';
|
52 |
const GUAP_UTILISATEUR = 'UTILISATEURAPROJET_ID_UTILISATEUR';
|
| 53 |
const GUAP_PROJET = 'UTILISATEURAPROJET_ID_PROJET';
|
53 |
const GUAP_PROJET = 'UTILISATEURAPROJET_ID_PROJET';
|
| 54 |
|
54 |
|
| 55 |
/*** Attributs : */
|
55 |
/*** Attributs : */
|
| 56 |
private $id_utilisateur;
|
56 |
private $id_utilisateur;
|
| 57 |
private $id_projet;
|
57 |
private $id_projet;
|
| 58 |
|
58 |
|
| 59 |
/*** Aggregations : */
|
59 |
/*** Aggregations : */
|
| 60 |
|
60 |
|
| 61 |
/*** Constructeur : */
|
61 |
/*** Constructeur : */
|
| 62 |
public function __construct($cmd = null, $parametres = null)
|
62 |
public function __construct($cmd = null, $parametres = null)
|
| 63 |
{
|
63 |
{
|
| 64 |
$this->dao_table_nom = 'gestion_utilisateur_a_projet';
|
64 |
$this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_utilisateur_a_projet';
|
| 65 |
$this->dao_correspondance = array(
|
65 |
$this->dao_correspondance = array(
|
| 66 |
'guap_id_utilisateur' => 'id_utilisateur',
|
66 |
'guap_id_utilisateur' => 'id_utilisateur',
|
| 67 |
'guap_id_projet' => 'id_projet');
|
67 |
'guap_id_projet' => 'id_projet');
|
| 68 |
|
68 |
|
| 69 |
// Si l'on veut remplir l'objet à la création on lance la requete correspondante
|
69 |
// Si l'on veut remplir l'objet à la création on lance la requete correspondante
|
| 70 |
if (!is_null($cmd)) {
|
70 |
if (!is_null($cmd)) {
|
| 71 |
$this->consulter($cmd, $parametres, true);
|
71 |
$this->consulter($cmd, $parametres, true);
|
| 72 |
}
|
72 |
}
|
| 73 |
}
|
73 |
}
|
| 74 |
|
74 |
|
| 75 |
/*** Accesseurs : */
|
75 |
/*** Accesseurs : */
|
| 76 |
// Id Utilisateur
|
76 |
// Id Utilisateur
|
| 77 |
public function getIdUtilisateur()
|
77 |
public function getIdUtilisateur()
|
| 78 |
{
|
78 |
{
|
| 79 |
return $this->id_utilisateur;
|
79 |
return $this->id_utilisateur;
|
| 80 |
}
|
80 |
}
|
| 81 |
public function setIdUtilisateur( $iu )
|
81 |
public function setIdUtilisateur( $iu )
|
| 82 |
{
|
82 |
{
|
| 83 |
$this->id_utilisateur = $iu;
|
83 |
$this->id_utilisateur = $iu;
|
| 84 |
}
|
84 |
}
|
| 85 |
|
85 |
|
| 86 |
// Id Projet
|
86 |
// Id Projet
|
| 87 |
public function getIdProjet()
|
87 |
public function getIdProjet()
|
| 88 |
{
|
88 |
{
|
| 89 |
return $this->id_projet;
|
89 |
return $this->id_projet;
|
| 90 |
}
|
90 |
}
|
| 91 |
public function setIdProjet( $ip )
|
91 |
public function setIdProjet( $ip )
|
| 92 |
{
|
92 |
{
|
| 93 |
$this->id_projet = $ip;
|
93 |
$this->id_projet = $ip;
|
| 94 |
}
|
94 |
}
|
| 95 |
|
95 |
|
| 96 |
/*** Méthodes : */
|
96 |
/*** Méthodes : */
|
| 97 |
|
97 |
|
| 98 |
/**
|
98 |
/**
|
| 99 |
* Consulter la table gestion_utilisateur_a_projet.
|
99 |
* Consulter la table gestion_utilisateur_a_projet.
|
| 100 |
* @return mixed un tableau d'objets UtilisateurAProjet s'il y en a plusieurs, l'objet UtilisateurAProjet s'il y en a 1 seul sinon false.
|
100 |
* @return mixed un tableau d'objets UtilisateurAProjet s'il y en a plusieurs, l'objet UtilisateurAProjet s'il y en a 1 seul sinon false.
|
| 101 |
*/
|
101 |
*/
|
| 102 |
public function consulter($cmd = '', $parametres = array(), $instancier = false)
|
102 |
public function consulter($cmd = '', $parametres = array(), $instancier = false)
|
| 103 |
{
|
103 |
{
|
| 104 |
switch ($cmd) {
|
104 |
switch ($cmd) {
|
| 105 |
case UtilisateurAProjet::GUAP_ID:
|
105 |
case UtilisateurAProjet::GUAP_ID:
|
| 106 |
$requete = 'SELECT * '.
|
106 |
$requete = 'SELECT * '.
|
| 107 |
'FROM gestion_utilisateur_a_projet '.
|
107 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_a_projet '.
|
| 108 |
'WHERE guap_id_utilisateur = #0 '.
|
108 |
'WHERE guap_id_utilisateur = #0 '.
|
| 109 |
' AND guap_id_projet = #1 ';
|
109 |
' AND guap_id_projet = #1 ';
|
| 110 |
break;
|
110 |
break;
|
| 111 |
case UtilisateurAProjet::GUAP_ID_MAX_UTILISATEUR:
|
111 |
case UtilisateurAProjet::GUAP_ID_MAX_UTILISATEUR:
|
| 112 |
$requete = 'SELECT MAX(guap_id_utilisateur) '.
|
112 |
$requete = 'SELECT MAX(guap_id_utilisateur) '.
|
| 113 |
'FROM gestion_utilisateur_a_projet ';
|
113 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_a_projet ';
|
| 114 |
break;
|
114 |
break;
|
| 115 |
case UtilisateurAProjet::GUAP_ID_MAX_PROJET:
|
115 |
case UtilisateurAProjet::GUAP_ID_MAX_PROJET:
|
| 116 |
$requete = 'SELECT MAX(guap_id_projet) '.
|
116 |
$requete = 'SELECT MAX(guap_id_projet) '.
|
| 117 |
'FROM gestion_utilisateur_a_projet ';
|
117 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_a_projet ';
|
| 118 |
break;
|
118 |
break;
|
| 119 |
case UtilisateurAProjet::GUAP_UTILISATEUR:
|
119 |
case UtilisateurAProjet::GUAP_UTILISATEUR:
|
| 120 |
$requete = 'SELECT * '.
|
120 |
$requete = 'SELECT * '.
|
| 121 |
'FROM gestion_utilisateur_a_projet '.
|
121 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_a_projet '.
|
| 122 |
'WHERE guap_id_utilisateur = #0 ';
|
122 |
'WHERE guap_id_utilisateur = #0 ';
|
| 123 |
break;
|
123 |
break;
|
| 124 |
case UtilisateurAProjet::GUAP_PROJET:
|
124 |
case UtilisateurAProjet::GUAP_PROJET:
|
| 125 |
$requete = 'SELECT * '.
|
125 |
$requete = 'SELECT * '.
|
| 126 |
'FROM gestion_utilisateur_a_projet '.
|
126 |
'FROM ' . GTT_BDD_PREFIXE . 'gestion_utilisateur_a_projet '.
|
| 127 |
'WHERE guap_id_projet = #0 ';
|
127 |
'WHERE guap_id_projet = #0 ';
|
| 128 |
break;
|
128 |
break;
|
| 129 |
default :
|
129 |
default :
|
| 130 |
$message = 'Commande '.$cmd.'inconnue!';
|
130 |
$message = 'Commande '.$cmd.'inconnue!';
|
| 131 |
$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
|
131 |
$e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
|
| 132 |
trigger_error($e, E_USER_ERROR);
|
132 |
trigger_error($e, E_USER_ERROR);
|
| 133 |
}
|
133 |
}
|
| 134 |
return parent::consulter($requete, $parametres, $instancier);
|
134 |
return parent::consulter($requete, $parametres, $instancier);
|
| 135 |
}
|
135 |
}
|
| 136 |
}
|
136 |
}
|
| 137 |
|
137 |
|
| 138 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
138 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| 139 |
*
|
139 |
*
|
| 140 |
* $Log$
|
140 |
* $Log$
|
| 141 |
*
|
141 |
*
|
| 142 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
142 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
| 143 |
*/
|
143 |
*/
|
| 144 |
?>
|
144 |
?>
|
| 145 |
|
145 |
|