Subversion Repositories Applications.gtt

Rev

Rev 170 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
// +------------------------------------------------------------------------------------------------------+
// | PHP version 5.1.1                                                                                    |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2006 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of eFlore.                                                                         |
// |                                                                                                      |
// | Foobar is free software; you can redistribute it and/or modify                                       |
// | it under the terms of the GNU General Public License as published by                                 |
// | the Free Software Foundation; either version 2 of the License, or                                    |
// | (at your option) any later version.                                                                  |
// |                                                                                                      |
// | Foobar is distributed in the hope that it will be useful,                                            |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
// | GNU General Public License for more details.                                                         |
// |                                                                                                      |
// | You should have received a copy of the GNU General Public License                                    |
// | along with Foobar; if not, write to the Free Software                                                |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id$
/**
* Classe AbsenceMotif
*
* Description
*
*@package eFlore
*@subpackage modele
//Auteur original :
*@version 3
*@author        Shaheen ABDOOL RAHEEM <shaheenar50@hotmail.com>
//Autres auteurs :
*@version 4
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
*@author        aucun
*@copyright     Tela-Botanica 2000-2006
*@version       $Revision$ $Date$
// +------------------------------------------------------------------------------------------------------+
*/

/**
* class AbsenceMotif : est à la fois le DAO et le conteneur de la table gestion_utilisateur.
* classe métier
*/
class AbsenceMotif extends aGttSql {
        /*** Constantes : */
        const GAM_TOUS = 'ABSENCEMOTIF_TOUS';
        const GAM_ID = 'ABSENCEMOTIF_ID';
        const GAM_ID_MAX = 'ABSENCEMOTIF_ID_MAX';
        const GAM_LIBELLE = 'ABSENCEMOTIF_LIBELLE';

        /*** Attributs : */
        private $id_absence_motif;
        private $libelle;
        private $mark_cp_diminuer;
        private $mark_hs_diminuer;
        
        /*** Aggregations : */

        /*** Constructeur : */
        public function __construct($cmd = null, $parametres = null)
        {
                $this->dao_table_nom = GTT_BDD_PREFIXE . 'gestion_absence_motif';
                $this->dao_correspondance = array(
                        'gam_id_absence_motif'  => 'id_absence_motif',
                        'gam_libelle'   => 'libelle',
                        'gam_mark_cp_diminuer'  => 'mark_cp_diminuer',
                        'gam_mark_hs_diminuer'  => 'mark_hs_diminuer');

                // Si l'on veut remplir l'objet à la création on lance la requete correspondante
                if (!is_null($cmd)) {
                        $this->consulter($cmd, $parametres, true);
                }
        }

        /*** Accesseurs : */
        // Id Absence Motif
        public function getIdAbsenceMotif()
        {
                return $this->id_absence_motif;
        }
        public function setIdAbsenceMotif( $iam )
        {
                $this->id_absence_motif = $iam;
        }

        // Libelle
        public function getLibelle()
        {
                return $this->libelle;
        }
        public function setLibelle( $l )
        {
                $this->libelle = $l;
        }

        // CP Diminuer
        public function getMarkCpDiminuer()
        {
                return $this->mark_cp_diminuer;
        }
        public function setMarkCpDiminuer( $cd )
        {
                $this->mark_cp_diminuer = $cd;
        }

        // HS Diminuer
        public function getMarkHsDiminuer()
        {
                return $this->mark_hs_diminuer;
        }
        public function setMarkHsDiminuer( $hd )
        {
                $this->mark_hs_diminuer = $hd;
        }

        /*** Méthodes : */

        /**
        * Consulter la table gestion_absence_motif.
        * @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.
        */
        public function consulter($cmd = '', $parametres = array(), $instancier = false)
        {
                switch ($cmd) {
                        case AbsenceMotif::GAM_TOUS:
                                $requete =      'SELECT * '.
                                                        'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif ';
                                break;
                        case AbsenceMotif::GAM_ID:
                                $requete =      'SELECT * '.
                                                        'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif '.
                                                        'WHERE gam_id_absence_motif = #0 ';
                                break;
                        case AbsenceMotif::GAM_ID_MAX:
                                $requete =      'SELECT MAX(gam_id_absence_motif) AS gam_id_absence_motif '.
                                                        'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif ';
                                break;
                        case AbsenceMotif::GAM_LIBELLE:
                                $requete =      'SELECT * '.
                                                        'FROM ' . GTT_BDD_PREFIXE . 'gestion_absence_motif '.
                                                        'WHERE gam_libelle = "#0" ';
                                break;
                        default :
                                $message = 'Commande '.$cmd.'inconnue!';
                                $e = GestionnaireErreur::formaterMessageErreur(__FILE__, __LINE__, $message);
                        trigger_error($e, E_USER_ERROR);
                }
                return parent::consulter($requete, $parametres, $instancier);
        }
}

/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log$
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>