Property | Type | Description | |
---|---|---|---|
$baseClassSuffix | suffix to append to the base model, setting "Base" will result in a model named "PostBase" | ||
$baseTraits | base-traits | ||
$createdAtColumn | the name of the column where the user who updated the entry is stored | ||
$createdByColumn | the name of the column where the user who created the entry is stored | ||
$generateHintsFromComments | This indicates whether the generator should generate attribute hints by using the comments of the corresponding DB columns | ||
$generateModelClass | whether to overwrite (extended) model classes, will be always created, if file does not exist | ||
$languageCodeColumn | the column name where the language code is stored | ||
$languageTableName | the name of the table containing the translations. {{table}} will be replaced with the value in "Table Name" field | ||
$messageCategory | |||
$removeDuplicateRelations | |||
$savedForm | form field for selecting and loading saved gii forms | ||
$singularEntities | |||
$tableNameMap | key-value pairs for mapping a table-name to class-name, eg. 'prefix_FOObar' => 'FooBar' | ||
$tablePrefix | string for the table prefix, which is ignored in generated class name | ||
$updatedAtColumn | the name of the column where the user who updated the entry is stored | ||
$updatedByColumn | the name of the column where the user who updated the entry is stored | ||
$useBlameableBehavior | whether or not to use BlameableBehavior | ||
$useTimestampBehavior | whether or not to use TimestampBehavior | ||
$useTranslatableBehavior | whether or not to use 2amigos/yii2-translateable-behavior |
Property | Type | Description | |
---|---|---|---|
$classNames2 |
Method | Description | |
---|---|---|
attributeLabels ( ) | ||
formAttributes ( ) : array | all form fields for saving in saved forms. | |
generate ( ) | ||
generateClassName ( string $tableName, $useSchemaName = null ) : string | Generates a class name from the specified table name. | |
generateHints ( yii\db\TableSchema $table ) : array | Generates the attribute hints for the specified table. | |
generateRelationName ( $relations, $table, $key, $multiple ) | ||
generateRules ( yii\db\TableSchema $table ) : array | Generates validation rules for the specified table and add enum value validation. | |
getDescription ( ) | ||
getEnum ( array $columns ) : array | prepare ENUM field values. | |
getName ( ) | ||
getTableNames ( ) | ||
hints ( ) | ||
isEnum ( $column ) : type | validate is ENUM. | |
requiredTemplates ( ) | ||
rules ( ) | ||
validateDb ( ) | Validates the [[db]] attribute. |
Method | Description | |
---|---|---|
extractTranslations ( $tableName, $relations ) : array | ||
generateBlameable ( yii\db\TableSchema $table ) : string[] | ||
generateRelations ( ) | ||
generateTimestamp ( yii\db\TableSchema $table ) : string[] | ||
getDbConnection ( ) : |
protected extractTranslations ( $tableName, $relations ) : array | ||
$relations | all database's relations | |
return | array | associative array containing the extracted relations and the modified translations |
public formAttributes ( ) : array | ||
return | array |
protected generateBlameable ( yii\db\TableSchema $table ) : string[] | ||
$table | yii\db\TableSchema | the table schema |
return | string[] |
public generateClassName ( string $tableName, $useSchemaName = null ) : string | ||
$tableName | string | the table name (which may contain schema prefix) |
return | string | the generated class name |
public generateHints ( yii\db\TableSchema $table ) : array | ||
$table | yii\db\TableSchema | the table schema |
return | array | the generated attribute hints (name => hint) or an empty array if $this->generateHintsFromComments is false |
public generateRelationName ( $relations, $table, $key, $multiple ) |
public generateRules ( yii\db\TableSchema $table ) : array | ||
$table | yii\db\TableSchema | the table schema |
return | array | the generated validation rules |
protected generateTimestamp ( yii\db\TableSchema $table ) : string[] | ||
$table | yii\db\TableSchema | the table schema |
return | string[] |
protected getDbConnection ( ) : |
||
return | the DB connection from the DI container or as application component specified by [[db]] |
public isEnum ( $column ) : type | ||
$column | table column | |
return | type |
public $baseClassSuffix |
public $createdAtColumn |
public $createdByColumn |
public $generateHintsFromComments |
public $generateModelClass |
public $languageCodeColumn |
public $languageTableName |
public $savedForm |
public $tableNameMap |
public $tablePrefix |
public $updatedAtColumn |
public $updatedByColumn |
public $useBlameableBehavior |
public $useTimestampBehavior |