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 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
Extended by CModel implements IteratorAggregate, ArrayAccess
Extended by CFormModel
Extended by CCodeModel
Extended by CrudCode
Extended by FullCrudCode
Package: system\gii
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 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

CrudCode::prepare
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

CrudCode::rules
public
# validateModel( mixed $attribute, mixed $params )

Overrides

CrudCode::validateModel
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...
));

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...
));

Returns

array
the attribute labels

Overrides

CrudCode::attributeLabels
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

CrudCode::init
public static
# suggestName( mixed $columns )
public array
# getRelations( )

Returns relations of current model

Returns relations of current model

Returns

array
public string
# generateActiveLabel( mixed $modelClass, mixed $column )

Prepend code fragments from parent class with an echo

Prepend code fragments from parent class with an echo

Parameters

$modelClass
mixed
$modelClass
$column
mixed
$column

Returns

string

Overrides

CrudCode::generateActiveLabel
public string
# generateActiveField( mixed $modelClass, mixed $column )

Get input field from provider

Get input field from provider

Parameters

$modelClass
mixed
$modelClass
$column
mixed
$column

Returns

string

Overrides

CrudCode::generateActiveField

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.

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

Phundament App Class Reference API documentation generated by ApiGen 2.8.0