classQDatabaseCodeGen
QDatabaseCodeGen Class Reference
Inherits QCodeGen.

Public Member Functions
- GetTable ($strTableName)
- GetColumn ($strTableName, $strColumnName)
- ValidateTableColumn ($strTableName, $strColumnName)
- GetTitle ()
- GetConfigXml ()
- GetReportLabel ()
- GenerateAll ()
- __construct ($objSettingsXml)
- GenerateTable (QTable $objTable)
- GenerateTypeTable (QTypeTable $objTypeTable)
- __get ($strName)
- __set ($strName, $mixValue)
Static Public Member Functions
- static GenerateAggregateHelper ($objCodeGenArray)
Protected Member Functions
- AnalyzeDatabase ()
- ListOfColumnsFromTable (QTable $objTable)
- GetColumnArray (QTable $objTable, $strColumnNameArray)
- AnalyzeAssociationTable ($strTableName)
- AnalyzeTypeTable (QTypeTable $objTypeTable)
- AnalyzeTable (QTable $objTable)
- AnalyzeTableColumn (QDatabaseFieldBase $objField, $objTable)
- StripPrefixFromTable ($strTableName)
- GetForeignKeyForQcodoRelationshipDefinition ($strTableName, $strLine)
- GetForeignKeyForSqlRelationshipDefinition ($strTableName, $strLine)
- GetForeignKeyHelper ($strLine, $strFkName, $strTableName, $strColumnName, $strReferencedTable, $strReferencedColumn)
- GetForeignKeysFromRelationshipsScript ($strTableName, $objForeignKeyArray)
Protected Attributes
- $objTableArray
- $strExcludedTableArray
- $objTypeTableArray
- $strAssociationTableNameArray
- $objDb
- $intDatabaseIndex
- $strTypeTableSuffix
- $intTypeTableSuffixLength
- $strAssociationTableSuffix
- $intAssociationTableSuffixLength
- $strStripTablePrefix
- $intStripTablePrefixLength
- $strExcludePattern
- $strExcludeListArray
- $strIncludePattern
- $strIncludeListArray
- $strAssociatedObjectPrefix
- $strAssociatedObjectSuffix
- $blnManualQuerySupport = false
- $strRelationships
- $blnRelationshipsIgnoreCase
- $strRelationshipsScriptPath
- $strRelationshipsScriptFormat
- $blnRelationshipsScriptIgnoreCase
- $strRelationshipLinesQcodo = array()
- $strRelationshipLinesSql = array()
- $strPatternTableName = '[[:alpha:]_][[:alnum:]_]*'
- $strPatternColumnName = '[[:alpha:]_][[:alnum:]_]*'
- $strPatternKeyName = '[[:alpha:]_][[:alnum:]_]*'
Constructor & Destructor Documentation
| QDatabaseCodeGen::__construct | ( | $ | objSettingsXml | ) |
References AnalyzeDatabase(), QType::Boolean, QType::Integer, and QCodeGenBase::LookupSetting().
Member Function Documentation
| QDatabaseCodeGen::__get | ( | $ | strName | ) |
Override method to perform a property "Get" This will get the value of $strName
- Parameters:
-
string strName Name of the property to get
- Returns:
- mixed
Reimplemented from QCodeGenBase.
References QCallerException::IncrementOffset().
| QDatabaseCodeGen::__set | ( | $ | strName, | |
| $ | mixValue | |||
| ) |
Override method to perform a property "Set" This will set the property $strName to be $mixValue All inhereted objects that call __set() should always fall through to calling parent::__set() in a try/catch statement catching for CallerExceptions.
- Parameters:
-
string $strName Name of the property to set string $mixValue New value of the property
- Returns:
- mixed the property that was set
Reimplemented from QCodeGenBase.
References QCallerException::IncrementOffset().
| QDatabaseCodeGen::AnalyzeAssociationTable | ( | $ | strTableName | ) | [protected] |
References AnalyzeTableColumn(), QCodeGenBase::CalculateGraphPrefixArray(), QCodeGenBase::CalculateObjectDescriptionForAssociation(), GetForeignKeysFromRelationshipsScript(), GetTable(), QCodeGenBase::PropertyNameFromColumn(), QCodeGenBase::ReverseReferenceVariableNameFromTable(), QCodeGenBase::ReverseReferenceVariableTypeFromTable(), and QCodeGenBase::VariableNameFromColumn().
Referenced by AnalyzeDatabase().
| QDatabaseCodeGen::AnalyzeDatabase | ( | ) | [protected] |
References QCodeGenBase::$CodeGenArray, AnalyzeAssociationTable(), AnalyzeTable(), AnalyzeTypeTable(), and GetTable().
Referenced by __construct().
| QDatabaseCodeGen::AnalyzeTable | ( | QTable $ | objTable | ) | [protected] |
References AnalyzeTableColumn(), QCodeGenBase::CalculateObjectDescription(), QCodeGenBase::CalculateObjectMemberVariable(), QCodeGenBase::CalculateObjectPropertyName(), QCodeGenBase::ClassNameFromTableName(), GetColumn(), GetForeignKeysFromRelationshipsScript(), GetTable(), QType::Object, QCodeGenBase::PhpReservedWords, QCodeGen::Pluralize(), QConvertNotationBase::PrefixFromType(), QCodeGenBase::PropertyNameFromColumn(), QCodeGenBase::ReferencePropertyNameFromColumn(), QCodeGenBase::ReferenceVariableNameFromColumn(), QCodeGenBase::ReverseReferenceVariableNameFromTable(), and QCodeGenBase::ReverseReferenceVariableTypeFromTable().
Referenced by AnalyzeDatabase().
| QDatabaseCodeGen::AnalyzeTableColumn | ( | QDatabaseFieldBase $ | objField, | |
| $ | objTable | |||
| ) | [protected] |
References QType::Constant(), QCodeGenBase::PropertyNameFromColumn(), QCodeGenBase::VariableNameFromColumn(), and QCodeGenBase::VariableTypeFromDbType().
Referenced by AnalyzeAssociationTable(), and AnalyzeTable().
| QDatabaseCodeGen::AnalyzeTypeTable | ( | QTypeTable $ | objTypeTable | ) | [protected] |
| static QDatabaseCodeGen::GenerateAggregateHelper | ( | $ | objCodeGenArray | ) | [static] |
References $objTableArray, and QCodeGenBase::GenerateFiles().
Referenced by QCodeGenBase::GenerateAggregate().
| QDatabaseCodeGen::GenerateAll | ( | ) |
References GenerateTable(), and GenerateTypeTable().
| QDatabaseCodeGen::GenerateTable | ( | QTable $ | objTable | ) |
| QDatabaseCodeGen::GenerateTypeTable | ( | QTypeTable $ | objTypeTable | ) |
| QDatabaseCodeGen::GetColumn | ( | $ | strTableName, | |
| $ | strColumnName | |||
| ) |
| QDatabaseCodeGen::GetColumnArray | ( | QTable $ | objTable, | |
| $ | strColumnNameArray | |||
| ) | [protected] |
| QDatabaseCodeGen::GetConfigXml | ( | ) |
| QDatabaseCodeGen::GetForeignKeyForQcodoRelationshipDefinition | ( | $ | strTableName, | |
| $ | strLine | |||
| ) | [protected] |
| QDatabaseCodeGen::GetForeignKeyForSqlRelationshipDefinition | ( | $ | strTableName, | |
| $ | strLine | |||
| ) | [protected] |
| QDatabaseCodeGen::GetForeignKeyHelper | ( | $ | strLine, | |
| $ | strFkName, | |||
| $ | strTableName, | |||
| $ | strColumnName, | |||
| $ | strReferencedTable, | |||
| $ | strReferencedColumn | |||
| ) | [protected] |
References ValidateTableColumn().
Referenced by GetForeignKeyForQcodoRelationshipDefinition(), and GetForeignKeyForSqlRelationshipDefinition().
| QDatabaseCodeGen::GetForeignKeysFromRelationshipsScript | ( | $ | strTableName, | |
| $ | objForeignKeyArray | |||
| ) | [protected] |
This will go through the various Relationships Script lines (if applicable) as setup during the __constructor() through the <relationships> and <relationshipsScript> tags in the configuration settings.
If no Relationships are defined, this method will simply exit making no changes.
- Parameters:
-
string $strTableName Name of the table to pull foreign keys for DatabaseForeignKeyBase[] Array of currently found DB FK objects which will be appended to
- Returns:
- DatabaseForeignKeyBase[] Array of DB FK objects that were parsed out
References GetForeignKeyForQcodoRelationshipDefinition(), and GetForeignKeyForSqlRelationshipDefinition().
Referenced by AnalyzeAssociationTable(), and AnalyzeTable().
| QDatabaseCodeGen::GetReportLabel | ( | ) |
| QDatabaseCodeGen::GetTable | ( | $ | strTableName | ) |
Referenced by AnalyzeAssociationTable(), AnalyzeDatabase(), AnalyzeTable(), and GetColumn().
| QDatabaseCodeGen::GetTitle | ( | ) |
| QDatabaseCodeGen::ListOfColumnsFromTable | ( | QTable $ | objTable | ) | [protected] |
| QDatabaseCodeGen::StripPrefixFromTable | ( | $ | strTableName | ) | [protected] |
| QDatabaseCodeGen::ValidateTableColumn | ( | $ | strTableName, | |
| $ | strColumnName | |||
| ) |
Given a CASE INSENSITIVE table and column name, it will return TRUE if the Table/Column exists ANYWHERE in the already analyzed database
- Parameters:
-
string $strTableName string $strColumnName
- Returns:
- boolean true if it is found/validated
Referenced by GetForeignKeyHelper().
Member Data Documentation
QDatabaseCodeGen::$blnManualQuerySupport = false [protected] |
QDatabaseCodeGen::$blnRelationshipsIgnoreCase [protected] |
QDatabaseCodeGen::$blnRelationshipsScriptIgnoreCase [protected] |
QDatabaseCodeGen::$intAssociationTableSuffixLength [protected] |
QDatabaseCodeGen::$intDatabaseIndex [protected] |
QDatabaseCodeGen::$intStripTablePrefixLength [protected] |
QDatabaseCodeGen::$intTypeTableSuffixLength [protected] |
QDatabaseCodeGen::$objDb [protected] |
QDatabaseCodeGen::$objTableArray [protected] |
Referenced by GenerateAggregateHelper().
QDatabaseCodeGen::$objTypeTableArray [protected] |
QDatabaseCodeGen::$strAssociatedObjectPrefix [protected] |
QDatabaseCodeGen::$strAssociatedObjectSuffix [protected] |
QDatabaseCodeGen::$strAssociationTableNameArray [protected] |
QDatabaseCodeGen::$strAssociationTableSuffix [protected] |
QDatabaseCodeGen::$strExcludedTableArray [protected] |
QDatabaseCodeGen::$strExcludeListArray [protected] |
QDatabaseCodeGen::$strExcludePattern [protected] |
QDatabaseCodeGen::$strIncludeListArray [protected] |
QDatabaseCodeGen::$strIncludePattern [protected] |
QDatabaseCodeGen::$strPatternColumnName = '[[:alpha:]_][[:alnum:]_]*' [protected] |
QDatabaseCodeGen::$strPatternKeyName = '[[:alpha:]_][[:alnum:]_]*' [protected] |
QDatabaseCodeGen::$strPatternTableName = '[[:alpha:]_][[:alnum:]_]*' [protected] |
QDatabaseCodeGen::$strRelationshipLinesQcodo = array() [protected] |
QDatabaseCodeGen::$strRelationshipLinesSql = array() [protected] |
QDatabaseCodeGen::$strRelationships [protected] |
QDatabaseCodeGen::$strRelationshipsScriptFormat [protected] |
QDatabaseCodeGen::$strRelationshipsScriptPath [protected] |
QDatabaseCodeGen::$strStripTablePrefix [protected] |
QDatabaseCodeGen::$strTypeTableSuffix [protected] |
The documentation for this class was generated from the following file:
- qcodo/_core/codegen/QDatabaseCodeGen.class.php
