noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 03/05: Improve dev tool


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 03/05: Improve dev tool
Date: Tue, 02 Feb 2016 14:36:17 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit b5dac900f9c79963748ac5a51400f1447e5676be
Author: Dany De Bontridder <address@hidden>
Date:   Sat Jan 30 19:11:03 2016 +0100

    Improve dev tool
---
 dev/SQL/table_sql.class.php     |   21 +++++++++++++++++----
 dev/SQL/template/script_sql.php |   34 ++++++++++++++++++++++++++--------
 2 files changed, 43 insertions(+), 12 deletions(-)

diff --git a/dev/SQL/table_sql.class.php b/dev/SQL/table_sql.class.php
index 19ac2cc..3fae9fb 100644
--- a/dev/SQL/table_sql.class.php
+++ b/dev/SQL/table_sql.class.php
@@ -1,10 +1,23 @@
 <?php
 
 /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
+ *   This file is part of NOALYSS.
+ *
+ *   NOALYSS 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.
+ *
+ *   NOALYSS 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 NOALYSS; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 
 /**
  * Description of Table_SQL
diff --git a/dev/SQL/template/script_sql.php b/dev/SQL/template/script_sql.php
index 3979fb0..6327596 100644
--- a/dev/SQL/template/script_sql.php
+++ b/dev/SQL/template/script_sql.php
@@ -1,18 +1,38 @@
+<?php echo '&lt;?php '; ?>
 
 
 /**
  * Autogenerated file 
- */
+ *   This file is part of NOALYSS.
+ *
+ *   NOALYSS 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.
+ *
+ *   NOALYSS 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 NOALYSS; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+require_once NOALYSS_INCLUDE.'/database/class_noalyss_sql.php';
+require_once NOALYSS_INCLUDE.'/lib/class_database.php';
+
+
 /**
- * <?php echo $this->table_name."_sql.class.php"."\n"; ?>
+ * <?php echo 'class_'.$this->table_name."_sql.php"."\n"; ?>
  *
  address@hidden
  address@hidden abstract of the table <?php echo 
$this->schema_name.".".$this->table_name?>
  */
-class <?php echo ucwords($this->table_name)."_SQL";?> extends SQL
+class <?php echo ucwords($this->table_name)."_SQL";?> extends Noalyss_SQL
 {
 
-function __construct($p_id=-1)
+function __construct(Database $p_cn,$p_id=-1)
   {
   $this->table = "<?php echo $this->schema_name.".".$this->table_name?>";
   $this->primary_key = "<?php echo  $this->pk?>";
@@ -52,13 +72,11 @@ function __construct($p_id=-1)
  
 
   $this->default = array(
-  "<?php echo $this->pk?>" => "auto",
+  "<?php echo $this->pk?>" => "auto"
   );
 
   $this->date_format = "DD.MM.YYYY";
-  global $cn;
-
-  parent::__construct($cn,$p_id);
+  parent::__construct($p_cn,$p_id);
   }
   
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]