ea-Geiercode
[ class tree: ea-Geier ] [ index: ea-Geier ] [ all elements ]

Source for file clients.db.php

Documentation is available at clients.db.php

  1. <?php 
  2. /**
  3.  * standard database functions for clients
  4.  *
  5.  * LICENSE:
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; either version 2 of the License, or
  9.  * (at your option) any later version.
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the
  13.  * GNU General Public License for more details.
  14.  * You should have received a copy of the GNU General Public License along
  15.  * with this program; if not, write to the Free Software Foundation, Inc.,
  16.  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17.  *
  18.  * @package       ea-Geier
  19.  * @subpackage code
  20.  * @author       m2mtech <tech@m2m.at>
  21.  * @copyright  2007 m2m server software gmbh
  22.  * @license       http://www.gnu.org/licenses/gpl.html GNU General Public License Version 2
  23.  * @version       $Id: clients.db.php 148 2007-09-07 16:02:29Z m2mtech $
  24.  * @link       http://www.ea-geier.at/
  25.  */
  26.  
  27. /**
  28.  * switch to client database but only once
  29.  *
  30.  * @param    eaDB    database
  31.  * @param    integer clientID
  32.  * @param    boolean    force switch
  33.  * @param    boolean    reset
  34.  * @return    integer itemID
  35.  */
  36. function dbChangeToClientDB(&$db$client$forceSwitch false$reset false{
  37.     static $switched false// store if already switched
  38.     
  39.         
  40.     if ($reset || $forceSwitch$switched false// force a switch
  41.     
  42.         
  43.     if ($resetreturn true;
  44.     
  45.     if ($switchedreturn true// if already switched do nothing
  46.     
  47.     $db->switchToClientDB($client);
  48.     
  49.     $switched true// do not switch again
  50.     
  51.     return true;
  52. }
  53.  
  54. ?>

Documentation generated on Sun, 09 Sep 2007 17:08:09 +0200 by phpDocumentor 1.3.1