PHP 클래스 ElementCode

상속: extends CCodeModel
파일 보기 프로젝트 열기: openeyes/openeyes

공개 프로퍼티들

프로퍼티 타입 설명
$authorEmail
$authorName
$baseClass
$baseControllerClass
$controllerClass
$elementFields
$elementName Properties
$ignore
$level
$migrationPath
$modelClass
$modelPath
$tableName
$tableSchema

공개 메소드들

메소드 설명
attributeLabels ( ) : array Attribute labels.
checkColumns ( $table ) * Check that all database field names conform to PHP variable naming rules For example mysql allows field name like "2011aa", but PHP does not allow variables like "$model->2011aa"
confirmed ( CCodeFile $file ) : boolean Checks to determine whether file should be saved.
generateActiveField ( string $modelClass, string $column ) : string Generates an appropriate input field for _form view.
generateActiveLabel ( string $modelClass, string $column ) : string Generates an appropriate label for a field of the element.
generateLabels ( CDbTableSchema $table ) : array Generates labels for fields of the table.
generateRules ( CDbTableSchema $table ) : array Generates rules for the table.
getTableSchema ( $tableName ) * Gets schema for passed tableName
init ( ) Runs on object initiation.
prepare ( ) * Run on form submission by preview or generate buttons. Generates the list of files and code
renderResults ( ) : string Write results and run migration scripts.
requiredTemplates ( ) : array List of templates that must be present.
resetGenerator ( ) * Resets all session variables to allow restart in case of error
resetTimeStamps ( ) Reset the time stamps.
rules ( ) Validation rules.
save ( ) : boolean Saves the generated views code into files NB Ensure _www has write permissions for elements directory.
successMessage ( ) * Returns a success message
validateBaseClass ( $attribute, array $params ) Validation method for base class.
validateElementFields ( $attribute, array $params ) Validation method for elementFields.
validateModelClass ( $attribute, array $params ) Validation method for model class and associated table.
validateModelPath ( $attribute, array $params ) Validation method for model path.
validateTableName ( $attribute, array $params ) Validation method for table name and model class.

보호된 메소드들

메소드 설명
createTimeStamp ( $description ) Creates time stamp in format expected for ./yiic migrate Stores in a session variable, otherwise time stamp changes on each second call.
generateClassName ( $tableName ) * Generates Yii style class name from table name
generateControllerName ( $modelClass ) * Generates Yii style controller name from class name
generateMigrationName ( $description, $tableName ) Generates a time stamped migration file name in format expected by ./yiic migrate.

메소드 상세

attributeLabels() 공개 메소드

Attribute labels.
public attributeLabels ( ) : array
리턴 array

checkColumns() 공개 메소드

* Check that all database field names conform to PHP variable naming rules For example mysql allows field name like "2011aa", but PHP does not allow variables like "$model->2011aa"
public checkColumns ( $table )
$table the table schema object

confirmed() 공개 메소드

Checks to determine whether file should be saved.
public confirmed ( CCodeFile $file ) : boolean
$file CCodeFile The file to be saved
리턴 boolean Whether the code file should be saved

createTimeStamp() 보호된 메소드

Creates time stamp in format expected for ./yiic migrate Stores in a session variable, otherwise time stamp changes on each second call.
protected createTimeStamp ( $description )

generateActiveField() 공개 메소드

Generates an appropriate input field for _form view.
public generateActiveField ( string $modelClass, string $column ) : string
$modelClass string Name of the element's model class
$column string Name of a table colum
리턴 string A form input element

generateActiveLabel() 공개 메소드

Generates an appropriate label for a field of the element.
public generateActiveLabel ( string $modelClass, string $column ) : string
$modelClass string Name of the element's model class
$column string Name of a table colum
리턴 string A label

generateClassName() 보호된 메소드

* Generates Yii style class name from table name
protected generateClassName ( $tableName )
$tableName Name of the table

generateControllerName() 보호된 메소드

* Generates Yii style controller name from class name
protected generateControllerName ( $modelClass )
$modelClass Name of the table

generateLabels() 공개 메소드

Generates labels for fields of the table.
public generateLabels ( CDbTableSchema $table ) : array
$table CDbTableSchema A table
리턴 array Array containing the labels

generateMigrationName() 보호된 메소드

Generates a time stamped migration file name in format expected by ./yiic migrate.
protected generateMigrationName ( $description, $tableName )

generateRules() 공개 메소드

Generates rules for the table.
public generateRules ( CDbTableSchema $table ) : array
$table CDbTableSchema A table
리턴 array Array of rules

getTableSchema() 공개 메소드

* Gets schema for passed tableName
public getTableSchema ( $tableName )
$tableName Name of table

init() 공개 메소드

Runs on object initiation.
public init ( )

prepare() 공개 메소드

* Run on form submission by preview or generate buttons. Generates the list of files and code
public prepare ( )

renderResults() 공개 메소드

Write results and run migration scripts.
public renderResults ( ) : string
리턴 string the code generation result log.

requiredTemplates() 공개 메소드

List of templates that must be present.
public requiredTemplates ( ) : array
리턴 array

resetGenerator() 공개 메소드

* Resets all session variables to allow restart in case of error
public resetGenerator ( )

resetTimeStamps() 공개 메소드

Reset the time stamps.
public resetTimeStamps ( )

rules() 공개 메소드

Validation rules.
public rules ( )

save() 공개 메소드

Saves the generated views code into files NB Ensure _www has write permissions for elements directory.
public save ( ) : boolean
리턴 boolean True if save is successful

successMessage() 공개 메소드

* Returns a success message
public successMessage ( )

validateBaseClass() 공개 메소드

Validation method for base class.
public validateBaseClass ( $attribute, array $params )
$params array Array of parameters

validateElementFields() 공개 메소드

Validation method for elementFields.
public validateElementFields ( $attribute, array $params )
$params array Array of parameters

validateModelClass() 공개 메소드

Validation method for model class and associated table.
public validateModelClass ( $attribute, array $params )
$params array Array of parameters

validateModelPath() 공개 메소드

Validation method for model path.
public validateModelPath ( $attribute, array $params )
$params array Array of parameters

validateTableName() 공개 메소드

Validation method for table name and model class.
public validateTableName ( $attribute, array $params )
$params array Array of parameters

프로퍼티 상세

$authorEmail 공개적으로 프로퍼티

public $authorEmail

$authorName 공개적으로 프로퍼티

public $authorName

$baseClass 공개적으로 프로퍼티

public $baseClass

$baseControllerClass 공개적으로 프로퍼티

public $baseControllerClass

$controllerClass 공개적으로 프로퍼티

public $controllerClass

$elementFields 공개적으로 프로퍼티

public $elementFields

$elementName 공개적으로 프로퍼티

Properties
public $elementName

$ignore 공개적으로 프로퍼티

public $ignore

$level 공개적으로 프로퍼티

public $level

$migrationPath 공개적으로 프로퍼티

public $migrationPath

$modelClass 공개적으로 프로퍼티

public $modelClass

$modelPath 공개적으로 프로퍼티

public $modelPath

$tableName 공개적으로 프로퍼티

public $tableName

$tableSchema 공개적으로 프로퍼티

public $tableSchema