Phundament App Class Reference
  • Package
  • Class
  • Tree

Packages

  • bootstrap
    • widgets
      • input
  • Image
  • None
  • p3admin
  • p3extensions
    • behaviors
    • commands
    • components
    • helpers
    • widgets
  • p3media
    • actions
    • controllers
    • models
  • p3pages
    • models
  • p3widgets
    • components
    • models
  • PHP
  • system
    • db
      • ar
    • gii
    • web
      • auth
      • helpers
      • widgets
  • yiiext
    • widgets
      • fancybox
      • lipsum
  • zii
    • widgets
      • grid

Classes

  • BootstrapCode
  • BootstrapGenerator
  • FullCrudCode
  • FullCrudGenerator
  • FullModelCode
  • FullModelGenerator

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
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CFormModel
Extended by CCodeModel
Extended by ModelCode
Extended by FullModelCode
Package: system\gii
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
# init( )

Initializes this model. This method is invoked in the constructor right after scenario is set. You may override this method to provide code that is needed to initialize the model (e.g. setting initial property values.)

Initializes this model. This method is invoked in the constructor right after scenario is set. You may override this method to provide code that is needed to initialize the model (e.g. setting initial property values.)

Overrides

ModelCode::init
public array
# rules( )

Declares the model validation rules. Child classes must override this method in the following format:

return array_merge(parent::rules(), array(
    ...rules for the child class...
));

Declares the model validation rules. Child classes must override this method in the following format:

return array_merge(parent::rules(), array(
    ...rules for the child class...
));

Returns

array
validation rules

Overrides

ModelCode::rules
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 CCodeModel::$files property with a list of code files to be generated.

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 CCodeModel::$files property with a list of code files to be generated.

Overrides

ModelCode::prepare
public array
# requiredTemplates( )

Returns a list of code templates that are required. Derived classes usually should override this method.

Returns a list of code templates that are required. Derived classes usually should override this method.

Returns

array
list of code templates that are required. They should be file paths relative to templatePath.

Overrides

ModelCode::requiredTemplates
public
# getBehaviors( mixed $columns )
public
# generateRules( mixed $table )

Overrides

ModelCode::generateRules
public
# getCreatetimeAttribute( mixed $columns )
public
# getUpdatetimeAttribute( mixed $columns )

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

Phundament App Class Reference API documentation generated by ApiGen 2.8.0