Class QCodeGenBase
This is the CodeGen class which performs the code generation for both the Object-Relational Model (e.g. Data Objects) as well as the draft Forms, which make up simple HTML/PHP scripts to perform basic CRUD functionality on each object.
- QBaseClass
- QCodeGenBase
public static
string
|
#
GetSettingsXml( )
Gets the settings in codegen_settings.xml file and returns its text without comments |
public static
|
|
public static
mixed
|
#
LookupSetting( SimpleXmlElement $objNode, string $strTagName, string $strAttributeName = null, string $strType =
This will lookup either the node value (if no attributename is passed in) or the attribute value for a given Tag. Node Searches only apply from the root level of the configuration XML being passed in (e.g. it will not be able to lookup the tag name of a grandchild of the root node) |
public static
array
|
|
public
boolean
|
#
GenerateFiles( string $strTemplatePrefix, mixed[] $mixArgumentArray )
Given a template prefix (e.g. db_orm_, db_type_, rest_, soap_, etc.), pull all the _*.tpl templates from any subfolders of the template prefix in QCodeGen::TemplatesPath and QCodeGen::TemplatesPathCustom, and call GenerateFile() on each one. If there are any template files that reside in BOTH TemplatesPath AND TemplatesPathCustom, then only use the TemplatesPathCustom one (which in essence overrides the one in TemplatesPath) |
protected
|
|
protected
SimpleXMLElement
|
#
getTemplateSettings( null|string $strTemplateFilePath, null|string & $strTemplate = null )
Returns the settings of the template file as SimpleXMLElement object |
public
mixed
|
#
GenerateFile( string $strModuleSubPath, string $strTemplateFilePath, mixed[] $mixArgumentArray, boolean $blnSave = true )
Generates a php code using a template file |
protected
|
#
setGeneratedFilePermissions( string $strFilePath )
Sets the file permissions (Linux only) for a file generated by the Code Generator |
protected
mixed|string
|
#
EvaluatePHP( $strFilename, $mixArgumentArray, null & $templateSettings = null )
Returns the evaluated PHP |
protected
string
|
#
ModelClassName( string $strTableName )
Given a table name, returns the name of the class for the corresponding model object. |
public
string
|
#
ModelVariableName( string $strTableName )
Given a table name, returns a variable name that will be used to represent the corresponding model object. |
protected
string
|
#
ModelReverseReferenceVariableName( string $strTableName )
Given a table name, returns the variable name that will be used to refer to the object in a reverse reference context (many-to-one). |
protected
string
|
#
ModelReverseReferenceVariableType( $strTableName )
Given a table name, returns the variable type of the object in a reverse reference context (many-to-one). |
protected
string
|
#
ModelColumnVariableName(
Given a column, returns the name of the variable used to represent the column's value inside the model object. |
protected
string
|
#
ModelColumnPropertyName( string $strColumnName )
Return the name of the property corresponding to the given column name as used in the getter and setter of the model object. |
protected
string
|
#
TypeColumnPropertyName( string $strColumnName )
Return the name of the property corresponding to the given column name as used in the getter and setter of a Type object. |
protected
string
|
#
ModelReferenceColumnName( string $strColumnName )
Given the name of a column that is a foreign key to another table, returns a kind of virtual column name that would refer to the object pointed to. This new name is not actually used, but derivatives of this name are used to represent a variable and property name that refers to this object that will get stored in the model. |
protected
string
|
#
ModelReferenceVariableName( string $strColumnName )
Given a column name to a foreign key, returns the name of the variable that will represent the foreign object stored in the model. |
protected
string
|
#
ModelReferencePropertyName( string $strColumnName )
Given a column name to a foreign key, returns the name of the property that will be used in the getter and setter to represent the foreign object stored in the model. |
protected
|
|
protected
|
|
protected
|
|
protected
|
|
public static
string
|
#
ModelConnectorControlName(
Returns the control label name as used in the ModelConnector corresponding to this column or table. |
public static
string
|
#
ModelConnectorPropertyName(
The property name used in the ModelConnector for the given column, virtual column or table |
public
string
|
#
ModelConnectorVariableName(
Return a variable name corresponding to the given column, including virtual columns like QReverseReference and QManyToMany references. |
public
string
|
#
ModelConnectorLabelVariableName(
Returns a variable name for the "label" version of a control, which would be the read-only version of viewing the data in the column. |
protected
string
|
#
ModelConnectorControlClass(
Returns the class for the control that will be created to edit the given column, including the 'virtual' columns of reverse references (many to one) and many-to-many references. |
public
|
|
public static
string
|
#
DataListControlName(
Returns the control label name as used in the data list panel corresponding to this column. |
public static
string
|
#
DataListItemName(
Returns the name of an item in the data list as will be displayed in the edit panel. |
public
|
|
public static
|
|
public static
|
|
public
|
#
GetControlCodeGenerator(
Returns the class for the control that will be created to edit the given column, including the 'virtual' columns of reverse references (many to one) and many-to-many references. |
public
|
|
protected
|
|
protected
|
|
protected
|
#
CalculateObjectDescription( $strTableName, $strColumnName, $strReferencedTableName, $blnPluralize )
|
protected
|
#
CalculateObjectDescriptionForAssociation( $strAssociationTableName, $strTableName, $strReferencedTableName, $blnPluralize )
|
protected
|
|
protected
string
|
#
VariableTypeFromDbType( string $strDbType )
Returns the variable type corresponding to the database column type |
protected
string
|
|
public
|
|
public
mixed
|
|
public
mixed|
|
OverrideAttributes(),
__call()
|
string |
PhpReservedWords
PHP Reserved Words. They make up: Invalid Type names -- these are reserved words which cannot be Type names in any user type table Invalid Table names -- these are reserved words which cannot be used as any table name Please refer to : http://php.net/manual/en/reserved.php |
#
'new, null, break, return, switch, self, case, const, clone, continue, declare, default, echo, else, elseif, empty, exit, eval, if, try, throw, catch, public, private, protected, function, extends, foreach, for, while, do, var, class, static, abstract, isset, unset, implements, interface, instanceof, include, include_once, require, require_once, abstract, and, or, xor, array, list, false, true, global, parent, print, exception, namespace, goto, final, endif, endswitch, enddeclare, endwhile, use, as, endfor, endforeach, this'
|
boolean |
DebugMode
DebugMode -- for Template Developers This will output the current evaluated template/statement to the screen On "eval" errors, you can click on the "View Rendered Page" to see what currently is being evaluated, which should hopefully aid in template debugging. |
#
false
|
protected
string
|
$strClassPrefix
Class Prefix, as specified in the codegen_settings.xml file |
|
protected
string
|
$strClassSuffix
Class suffix, as specified in the codegen_settings.xml file |
|
protected
string
|
$strErrors
Errors and Warnings collected during the process of codegen * |
|
protected
string
|
$strWarnings
Warnings collected during the codegen process. |
|
public static
array
|
$TemplatePaths
The list of template base paths to search, in order, when looking for a particular template. Set this to insert new template paths. If not set, the default will be the project template path, following by the qcubed core path. |
|
public static
|
$CodeGenArray
This static array contains an array of active and executed codegen objects, based on the XML Configuration passed in to Run() |
|
protected static
string[]
|
$SettingsXmlArray
This is the array representation of the parsed SettingsXml for reportback purposes. |
|
protected static
SimpleXmlElement
|
$SettingsXml
This is the SimpleXML representation of the Settings XML file |
|
public static
|
$SettingsFilePath
|
|
public static
string
|
$ApplicationName
Application Name (from CodeGen Settings) |
|
public static
string
|
$PreferredRenderMethod
Preferred Render Method (from CodeGen Settings) |
|
public static
string
|
$CreateMethod
Create Method (from CodeGen Settings) |
|
public static
string
|
$DefaultButtonClass
Default Button Class (from CodeGen Settings) |
|
protected static
string
|
$TemplateEscapeBegin
Template Escape Begin (from CodeGen Settings) |
|
protected static
|
$TemplateEscapeBeginLength
|
|
protected static
string
|
$TemplateEscapeEnd
Template Escape End (from CodeGen Settings) |
|
protected static
|
$TemplateEscapeEndLength
|
|
public static
string
|
$RootErrors
|
#
''
|
protected static
string[]
|
$DirectoriesToExcludeArray
array of directories to be excluded in codegen (lower cased) |
#
array('.','..','.svn','svn','cvs','.git')
|
public
string
|
$Errors
List of errors |
public
string
|
$Warnings
List of warnings |