Свойство | Тип | Описание | |
---|---|---|---|
$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. |
public attributeLabels ( ) : array | ||
Результат | array |
public checkColumns ( $table ) | ||
$table | the table schema object |
protected createTimeStamp ( $description ) |
protected generateClassName ( $tableName ) | ||
$tableName | Name of the table |
protected generateControllerName ( $modelClass ) | ||
$modelClass | Name of the table |
public generateLabels ( CDbTableSchema $table ) : array | ||
$table | CDbTableSchema | A table |
Результат | array | Array containing the labels |
protected generateMigrationName ( $description, $tableName ) |
public generateRules ( CDbTableSchema $table ) : array | ||
$table | CDbTableSchema | A table |
Результат | array | Array of rules |
public getTableSchema ( $tableName ) | ||
$tableName | Name of table |
public prepare ( ) |
public renderResults ( ) : string | ||
Результат | string | the code generation result log. |
public requiredTemplates ( ) : array | ||
Результат | array |
public resetGenerator ( ) |
public validateBaseClass ( $attribute, array $params ) | ||
$params | array | Array of parameters |
public validateElementFields ( $attribute, array $params ) | ||
$params | array | Array of parameters |
public validateModelClass ( $attribute, array $params ) | ||
$params | array | Array of parameters |
public validateModelPath ( $attribute, array $params ) | ||
$params | array | Array of parameters |
public validateTableName ( $attribute, array $params ) | ||
$params | array | Array of parameters |