phpDocumentor lodel
[ class tree: lodel ] [ index: lodel ] [ all elements ]

Source for file genericdao.php

Documentation is available at genericdao.php

  1. <?php
  2. /**
  3.  * Fichier de la classe GenericDAO
  4.  *
  5.  * PHP versions 4 et 5
  6.  *
  7.  * LODEL - Logiciel d'Edition ELectronique.
  8.  *
  9.  * Copyright (c) 2001-2002, Ghislain Picard, Marin Dacos
  10.  * Copyright (c) 2003, Ghislain Picard, Marin Dacos, Luc Santeramo, Nicolas Nutten, Anne Gentil-Beccot
  11.  * Copyright (c) 2004, Ghislain Picard, Marin Dacos, Luc Santeramo, Anne Gentil-Beccot, Bruno Cénou
  12.  * Copyright (c) 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  13.  * Copyright (c) 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  14.  * Copyright (c) 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  15.  *
  16.  * Home page: http://www.lodel.org
  17.  *
  18.  * E-Mail: lodel@lodel.org
  19.  *
  20.  * All Rights Reserved
  21.  *
  22.  * This program is free software; you can redistribute it and/or modify
  23.  * it under the terms of the GNU General Public License as published by
  24.  * the Free Software Foundation; either version 2 of the License, or
  25.  * (at your option) any later version.
  26.  *
  27.  * This program is distributed in the hope that it will be useful,
  28.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  29.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  30.  * GNU General Public License for more details.
  31.  *
  32.  * You should have received a copy of the GNU General Public License
  33.  * along with this program; if not, write to the Free Software
  34.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  35.  *
  36.  * @author Ghislain Picard
  37.  * @author Jean Lamy
  38.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  39.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  40.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  41.  * @licence http://www.gnu.org/copyleft/gpl.html
  42.  * @since Fichier ajouté depuis la version 0.8
  43.  * @version CVS:$Id:
  44.  */
  45.  
  46. /**
  47.  * Classe GenericDAO
  48.  *
  49.  * <p>Cette classe permet de gérer les éléments génériques de l'interface</p>
  50.  * @package lodel
  51.  * @author Ghislain Picard
  52.  * @author Jean Lamy
  53.  * @copyright 2005, Ghislain Picard, Marin Dacos, Luc Santeramo, Gautier Poupeau, Jean Lamy, Bruno Cénou
  54.  * @copyright 2006, Marin Dacos, Luc Santeramo, Bruno Cénou, Jean Lamy, Mikaël Cixous, Sophie Malafosse
  55.  * @copyright 2007, Marin Dacos, Bruno Cénou, Sophie Malafosse, Pierre-Alain Mignot
  56.  * @licence http://www.gnu.org/copyleft/gpl.html
  57.  * @version CVS:$Id:
  58.  * @since Classe ajoutée depuis la version 0.8
  59.  * @see genericlogic.php
  60.  */
  61.  
  62. class genericDAO extends DAO
  63. {
  64.     /**
  65.      * Constructeur
  66.      *
  67.      * @param string $table la table SQL de la DAO
  68.      * @param string $idfield Indique le nom du champ identifiant
  69.      */
  70.     function genericDAO($table$idfield)
  71.     {
  72.         $this->DAO($tablefalse$idfield)// create the class
  73.     }
  74.  
  75.     /**
  76.      * Instantie un nouvel objet virtuel (VO)
  77.      *
  78.      * Instantiate a new object
  79.      *
  80.      * @param object &$vo l'objet virtuel qui sera instancié
  81.      */
  82.     function instantiateObject(&$vo)
  83.     {
  84.         static $def;
  85.         $classname $this->table."VO";
  86.         if (!$def[$classname]{
  87.             eval ("class "$classname" { var $"$this->idfield"; } ");
  88.             $def[$classnametrue;
  89.         }
  90.         $vo new $classname// the same name as the table. We don't use factory...
  91.     }
  92.     /**
  93.      * Retourne les droits correspondant à un access particulier
  94.      *
  95.      * @access private
  96.      * @param string $access l'accès pour lequel on veut les droits
  97.      * @return Retourne une chaîne vide.
  98.      */
  99.     function _rightscriteria($access)
  100.     {
  101.         return '';
  102.     }
  103. }
  104. ?>

Documentation generated on Thu, 19 Jun 2008 05:07:49 +0200 by phpDocumentor 1.4.0a2