Class FullCrudCode
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 FullCrudCode::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
-
CrudCode
-
FullCrudCode
Author: Qiang Xue <qiang.xue@gmail.com>
Version: $Id$
Since: 1.1.2
Located at phundament/gii-template-collection/fullCrud/FullCrudCode.php
Methods summary
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
|
|
public
|
|
public
array
|
#
attributeLabels( )
Declares the model attribute labels. Child classes must override this method in the following format: return array_merge(parent::attributeLabels(), array( ...labels for the child class attributes... )); |
public
|
|
public static
|
|
public
array
|
|
public
string
|
#
generateActiveLabel( mixed $modelClass, mixed $column )
Prepend code fragments from parent class with an echo |
public
string
|
Methods inherited from CrudCode
generateInputField()
,
generateInputLabel()
,
getControllerClass()
,
getControllerFile()
,
getControllerID()
,
getModelClass()
,
getModule()
,
getTableSchema()
,
getUniqueControllerID()
,
getViewPath()
,
guessNameColumn()
,
requiredTemplates()
,
successMessage()
Methods inherited from CCodeModel
class2id()
,
class2name()
,
class2var()
,
classExists()
,
confirmed()
,
errorMessage()
,
getStickyFile()
,
getTemplatePath()
,
getTemplates()
,
loadStickyAttributes()
,
pluralize()
,
render()
,
renderResults()
,
save()
,
saveStickyAttributes()
,
sticky()
,
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
integer
|
$validation | |
public
mixed
|
$identificationColumn | |
public
string
|
$baseControllerClass | |
public
mixed
|
$codeProvider | |
public
string
|
$authTemplate | |
public
string
|
$messageCatalog | |
public
string
|
$template |
#
the name of the code template that the user has selected. The value of this property is internally managed by this class and CCodeGenerator. |
Properties inherited from CrudCode
$controller
,
$model
Properties inherited from CCodeModel
$answers
,
$files
,
$keywords
,
$status
Magic properties inherited from CCodeModel
$stickyFile
,
$templatePath
,
$templates
Magic properties inherited from CModel
$attributes
,
$errors
,
$iterator
,
$safeAttributeNames
,
$scenario
,
$validatorList
,
$validators