noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
class_anc_key_sql.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * Copyright (C) 2014 Dany De Bontridder <danydb@aevalys.eu>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019  */
00020 
00021 /**
00022  * @file
00023  * @brief Class to manage distribution keys for SQL.  
00024  *
00025  */
00026 require_once 'class_noalyss_sql.php';
00027 
00028 
00029 /**
00030  * @brief Manage the table key_distribution.
00031  */
00032 class Anc_Key_SQL extends Noalyss_SQL
00033 {
00034 
00035     function __construct($p_cn, $p_id = -1)
00036     {
00037         $this->table = "public.key_distribution";
00038         $this->primary_key = "kd_id";
00039 
00040         $this->name = array(
00041             "id" => "kd_id",
00042             "name"=>"kd_name",
00043             "description"=>"kd_description"
00044         );
00045 
00046         $this->type = array(
00047             "kd_id" => "numeric",
00048             "kd_name" => "text",
00049             "kd_description" => "text"
00050         );
00051 
00052         $this->default = array(
00053             "kd_id" => "auto"
00054         );
00055        // PHPUNIT seems to have a problem with this line
00056        //global $cn;
00057 
00058         parent::__construct($p_cn, $p_id);
00059     }
00060 
00061 }
00062 /**
00063  * @brief manage table key_distribution_ledger
00064  */
00065 class Anc_Key_Ledger_SQL extends Noalyss_SQL
00066 {
00067        function __construct(&$p_cn, $p_id = -1)
00068     {
00069         $this->table = "public.key_distribution_ledger";
00070         $this->primary_key = "kl_id";
00071 
00072         $this->name = array(
00073             "id" => "kl_id",
00074             "key"=>"kd_id",
00075             "ledger"=>"jrn_def_id"
00076         );
00077 
00078         $this->type = array(
00079             "kl_id" => "numeric",
00080             "kd_id" => "numeric",
00081             "jrn_def_id" => "numeric"
00082         );
00083 
00084         $this->default = array(
00085             "kl_id" => "auto"
00086         );
00087         // PHPUNIT seems to have a problem with this line
00088        //global $cn;
00089 
00090         parent::__construct($p_cn, $p_id);
00091     } 
00092 }
00093 /**
00094  * @brief manage table key_distribution_detail
00095  */
00096 class Anc_Key_Detail_SQL extends Noalyss_SQL
00097 {
00098        function __construct(&$p_cn, $p_id = -1)
00099     {
00100           
00101         $this->table = "public.key_distribution_detail";
00102         $this->primary_key = "ke_id";
00103 
00104         $this->name = array(
00105             "id" => "ke_id",
00106             "key"=>"kd_id",
00107             "row"=>"ke_row",
00108             "percent"=>"ke_percent"
00109         );
00110 
00111         $this->type = array(
00112             "ke_id" => "numeric",
00113             "kd_id" => "numeric",
00114             "ke_row" => "numeric",
00115             "ke_percent" => "numeric"
00116         );
00117 
00118         $this->default = array(
00119             "ke_id" => "auto"
00120         );
00121        // PHPUNIT seems to have a problem with this line
00122        //global $cn;
00123        
00124 
00125         parent::__construct($p_cn, $p_id);
00126     } 
00127 }
00128 /**
00129  * @brief manage table key_distribution_activity
00130  */
00131 class Anc_Key_Activity_SQL extends Noalyss_SQL
00132 {
00133        function __construct($p_cn, $p_id = -1)
00134     {
00135         $this->table = "public.key_distribution_activity";
00136         $this->primary_key = "ka_id";
00137 
00138         $this->name = array(
00139             "id" => "ka_id",
00140             "detail"=>"ke_id",
00141             "activity"=>"po_id",
00142             "plan"=>"pa_id"
00143         );
00144 
00145         $this->type = array(
00146             "ka_id" => "numeric",
00147             "ke_id" => "numeric",
00148             "po_id" => "numeric",
00149             "pa_id" => "numeric"
00150            
00151         );
00152 
00153         $this->default = array(
00154             "ka_id" => "auto"
00155         );
00156 
00157         parent::__construct($p_cn, $p_id);
00158     } 
00159 }
 All Data Structures Namespaces Files Functions Variables Enumerations