Source for file OCSP_FORM_DBCTRL_mySQL.phpclass
Documentation is available at OCSP_FORM_DBCTRL_mySQL.phpclass
* Class file OCSP_FORM_DBCTRL_mySQL.phpclass
* @project Open CSP-Management
* @author Peter Krebs (pk) <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @requires OCSP_FORM_DBCONTROLL.phpclass
* @version $Id: OCSP_FORM_DBCTRL_mySQL.phpclass,v 1.8 2008/06/02 21:09:27 pitlinz Exp $
require_once dirname(__FILE__
).
"/OCSP_FORM_DBCONTROLL.phpclass";
* class OCSP_FORM_DBCONTROLL
* root class of database handling for form fields
* @project Open CSP-Management
* @author Peter Krebs (pk) <pitlinz@users.sourceforge.net>
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id: OCSP_FORM_DBCTRL_mySQL.phpclass,v 1.8 2008/06/02 21:09:27 pitlinz Exp $
function generateColDesc($colName,$colType,$table=
__OCSP_NO_DBFIELD__,$size=
'0',$debug=
FALSE)
$arr_colDesc=
parent::generateColDesc($colName,$colType,$table,$size,$debug);
case "char":
// <pk-08-02-27>
$arr_colDesc['TYPE']=
"VARCHAR";
else if ($size>
255) $size=
255;
$arr_colDesc['LEN']=
$size;
$arr_colDesc['TYPE']=
"INT";
$arr_colDesc['LEN'] =
"11";
$arr_colDesc['TYPE']=
"TINYINT";
$arr_colDesc['LEN'] =
$size;
} else if (intval($size) <
7) {
$arr_colDesc['TYPE']=
"SMALLINT";
$arr_colDesc['LEN'] =
$size;
} else if (intval($size) <
12) {
$arr_colDesc['TYPE']=
"INT";
$arr_colDesc['LEN'] =
$size;
if ($size >
20) $size=
20;
$arr_colDesc['TYPE']=
"BIGINT";
$arr_colDesc['LEN'] =
$size;
$arr_colDesc['TYPE']=
"TIME";
$arr_colDesc['TYPE']=
"DATE";
$arr_colDesc['TYPE']=
"DATETIME";
$arr_colDesc['TYPE']=
"TIMESTAMP";
case "float":
// <pk-08-06-02 />
$arr_colDesc['TYPE']=
"FLOAT";
$arr_colDesc['LEN']=
NULL;
$arr_colDesc['TYPE']=
"TEXT";
$arr_colDesc['LEN']=
NULL;
$arr_colDesc['TYPE']=
"BLOB";
$arr_colDesc['LEN']=
NULL;
case "layout":
// no database value only template or fix text form output
$arr_colDesc['TYPE']=
"LAYOUT";
ocsp_logError(__FILE__
,__LINE__
,"$colType not defined",E_NOTICE);
* @param return DBMS_FIELD (the class best fit for dbType)
* @todo OCSP_FORM_DBCTRL_mySQL::use settings in T_DBMS_FIELDDESC
if ($colDesc['AUTO_INCREMENT'])
return new DBMS_FIELD_INT($colDesc['TABLE'],$colDesc['COLNAME'],$colDesc);
return new DBMS_FIELD_DATE($colDesc['TABLE'],$colDesc['COLNAME'],$colDesc);
case "char":
// <pk-08-01-23 />
if ($colDesc['LEN'] >
128)
return new DBMS_FIELD($colDesc['TABLE'],$colDesc['COLNAME'],$colDesc);
ocsp_logError(__FILE__
,__LINE__
,"unknown column type: <pre>".
print_r($colDesc,TRUE).
"</pre>",E_NOTICE);
return new DBMS_FIELD($colDesc['TABLE'],$colDesc['COLNAME'],$colDesc);
Documentation generated on Thu, 08 Jan 2009 17:46:03 +0100 by phpDocumentor 1.4.0a2