Author: danydb
Date: 2011-06-11 02:15:52 +0200 (Sat, 11 Jun 2011)
New Revision: 4163

Modified:
   phpcompta/branches/rel560/dev/manage-code/create-file/create_phpclass.py
Log:
Improve creation of php script

Modified: 
phpcompta/branches/rel560/dev/manage-code/create-file/create_phpclass.py
===================================================================
--- phpcompta/branches/rel560/dev/manage-code/create-file/create_phpclass.py    
2011-06-11 00:14:22 UTC (rev 4162)
+++ phpcompta/branches/rel560/dev/manage-code/create-file/create_phpclass.py    
2011-06-11 00:15:52 UTC (rev 4163)
@@ -14,6 +14,8 @@
 # second line = pk
 
 import sys, getopt
+import pdb
+
 def help():
     print """
     option are -h for help
@@ -77,7 +79,7 @@
         
         if ( $p_id == -1 ) {
         /* Initialize an empty object */
-            foreach ($this->variable as $key=>$value) $this->$value='DEFAULT';
+            foreach ($this->variable as $key=>$value) $this->$value=null;
             $this->@id@=$p_id;
         } else {
          /* load it */
@@ -543,6 +545,7 @@
                (col_id,col_type,default)=e.split('|')
                col_id=col_id.strip()
                col_type=col_type.strip()
+               verify_data_type+=" if ( trim($this->"+col_id+") == '') 
$this->"+col_id+"=null;\n"
                if col_type in ('float','integer','numeric','bigint') :
                    verify_data_type+="if ( $this->"+col_id+"!== null && 
settype($this->"+col_id+",'float') == false )\n \
             throw new Exception('DATATYPE "+col_id+" $this->"+col_id+" non 
numerique');\n"


_______________________________________________
Phpcompta-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/phpcompta-dev

Reply via email to