Class FullModelCode
CCodeModel is the base class for model classes that are used to generate code.
Each code generator should have at least one code model class that extends from this class. The purpose of a code model is to represent user-supplied parameters and use them to generate customized code.
Derived classes should implement the FullModelCode::prepare()
method whose main task
is to fill up the CCodeModel::$files
property based on the user parameters.
The CCodeModel::$files
property should be filled with a set of CCodeFile
instances, each representing a single code file to be generated.
CCodeModel implements the feature of "sticky attributes". A sticky attribute is an attribute that can remember its last valid value, even if the user closes his browser window and reopen it. To declare an attribute is sticky, simply list it in a validation rule with the validator name being "sticky".
- CComponent
-
CModel implements IteratorAggregate, ArrayAccess
-
CFormModel
-
CCodeModel
-
ModelCode
-
FullModelCode
Author: Qiang Xue <qiang.xue@gmail.com>
Version: $Id$
Since: 1.1.2
Located at phundament/gii-template-collection/fullModel/FullModelCode.php
Methods summary
public
|
|
public
array
|
|
public
|
#
prepare( )
Prepares the code files to be generated. This is the main method that child
classes should implement. It should contain the logic that populates the |
public
array
|
#
requiredTemplates( )
Returns a list of code templates that are required. Derived classes usually should override this method. |
public
|
|
public
|
|
public
|
|
public
|
Methods inherited from ModelCode
attributeLabels()
,
checkColumns()
,
generateClassName()
,
generateLabels()
,
generateRelationName()
,
generateRelations()
,
getRelations()
,
getTableSchema()
,
isRelationTable()
,
removePrefix()
,
validateBaseClass()
,
validateConnectionId()
,
validateModelPath()
,
validateTableName()
Methods inherited from CCodeModel
class2id()
,
class2name()
,
class2var()
,
classExists()
,
confirmed()
,
errorMessage()
,
getStickyFile()
,
getTemplatePath()
,
getTemplates()
,
loadStickyAttributes()
,
pluralize()
,
render()
,
renderResults()
,
save()
,
saveStickyAttributes()
,
sticky()
,
successMessage()
,
validateReservedWord()
,
validateTemplate()
Methods inherited from CFormModel
__construct()
,
attributeNames()
Methods inherited from CModel
addError()
,
addErrors()
,
afterConstruct()
,
afterValidate()
,
beforeValidate()
,
behaviors()
,
clearErrors()
,
createValidators()
,
generateAttributeLabel()
,
getAttributeLabel()
,
getAttributes()
,
getError()
,
getErrors()
,
getIterator()
,
getSafeAttributeNames()
,
getScenario()
,
getValidatorList()
,
getValidators()
,
hasErrors()
,
isAttributeRequired()
,
isAttributeSafe()
,
offsetExists()
,
offsetGet()
,
offsetSet()
,
offsetUnset()
,
onAfterConstruct()
,
onAfterValidate()
,
onBeforeValidate()
,
onUnsafeAttribute()
,
setAttributes()
,
setScenario()
,
unsetAttributes()
,
validate()
Methods inherited from CComponent
__call()
,
__get()
,
__isset()
,
__set()
,
__unset()
,
asa()
,
attachBehavior()
,
attachBehaviors()
,
attachEventHandler()
,
canGetProperty()
,
canSetProperty()
,
detachBehavior()
,
detachBehaviors()
,
detachEventHandler()
,
disableBehavior()
,
disableBehaviors()
,
enableBehavior()
,
enableBehaviors()
,
evaluateExpression()
,
getEventHandlers()
,
hasEvent()
,
hasEventHandler()
,
hasProperty()
,
raiseEvent()
Magic methods summary
Constants summary
Constants inherited from CCodeModel
STATUS_ERROR
,
STATUS_NEW
,
STATUS_PREVIEW
,
STATUS_SUCCESS
Properties summary
public
mixed
|
$tables | |
public
string
|
$baseClass | |
public
mixed
|
$identificationColumn | |
public
string
|
$messageCatalog |
Properties inherited from ModelCode
$buildRelations
,
$connectionId
,
$modelClass
,
$modelPath
,
$relations
,
$tableName
,
$tablePrefix
Properties inherited from CCodeModel
$answers
,
$files
,
$keywords
,
$status
,
$template
Magic properties inherited from CCodeModel
$stickyFile
,
$templatePath
,
$templates
Magic properties inherited from CModel
$attributes
,
$errors
,
$iterator
,
$safeAttributeNames
,
$scenario
,
$validatorList
,
$validators