PHP 클래스 schmunk42\giiant\generators\model\Generator

부터: 0.0.1
저자: Tobias Munk ([email protected])
상속: extends yii\gii\generators\model\Generator
파일 보기 프로젝트 열기: schmunk42/yii2-giiant 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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

보호된 프로퍼티들

프로퍼티 타입 설명
$classNames2

공개 메소드들

메소드 설명
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.

보호된 메소드들

메소드 설명
extractTranslations ( $tableName, $relations ) : array
generateBlameable ( yii\db\TableSchema $table ) : string[]
generateRelations ( )
generateTimestamp ( yii\db\TableSchema $table ) : string[]
getDbConnection ( ) : Connection

메소드 상세

attributeLabels() 공개 메소드

public attributeLabels ( )

extractTranslations() 보호된 메소드

protected extractTranslations ( $tableName, $relations ) : array
$relations all database's relations
리턴 array associative array containing the extracted relations and the modified translations

formAttributes() 공개 메소드

all form fields for saving in saved forms.
public formAttributes ( ) : array
리턴 array

generate() 공개 메소드

public generate ( )

generateBlameable() 보호된 메소드

protected generateBlameable ( yii\db\TableSchema $table ) : string[]
$table yii\db\TableSchema the table schema
리턴 string[]

generateClassName() 공개 메소드

Generates a class name from the specified table name.
public generateClassName ( string $tableName, $useSchemaName = null ) : string
$tableName string the table name (which may contain schema prefix)
리턴 string the generated class name

generateHints() 공개 메소드

Generates the attribute hints for the specified table.
public generateHints ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table schema
리턴 array the generated attribute hints (name => hint) or an empty array if $this->generateHintsFromComments is false

generateRelationName() 공개 메소드

public generateRelationName ( $relations, $table, $key, $multiple )

generateRelations() 보호된 메소드

protected generateRelations ( )

generateRules() 공개 메소드

Generates validation rules for the specified table and add enum value validation.
public generateRules ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table schema
리턴 array the generated validation rules

generateTimestamp() 보호된 메소드

protected generateTimestamp ( yii\db\TableSchema $table ) : string[]
$table yii\db\TableSchema the table schema
리턴 string[]

getDbConnection() 보호된 메소드

protected getDbConnection ( ) : Connection
리턴 yii\db\Connection the DB connection from the DI container or as application component specified by [[db]]

getDescription() 공개 메소드

public getDescription ( )

getEnum() 공개 메소드

prepare ENUM field values.
public getEnum ( array $columns ) : array
$columns array
리턴 array

getName() 공개 메소드

public getName ( )

getTableNames() 공개 메소드

public getTableNames ( )

hints() 공개 메소드

public hints ( )

isEnum() 공개 메소드

validate is ENUM.
public isEnum ( $column ) : type
$column table column
리턴 type

requiredTemplates() 공개 메소드

public requiredTemplates ( )

rules() 공개 메소드

public rules ( )

validateDb() 공개 메소드

Validates the [[db]] attribute.
public validateDb ( )

프로퍼티 상세

$baseClassSuffix 공개적으로 프로퍼티

suffix to append to the base model, setting "Base" will result in a model named "PostBase"
public $baseClassSuffix

$baseTraits 공개적으로 프로퍼티

base-traits
public $baseTraits

$classNames2 보호되어 있는 프로퍼티

protected $classNames2

$createdAtColumn 공개적으로 프로퍼티

the name of the column where the user who updated the entry is stored
public $createdAtColumn

$createdByColumn 공개적으로 프로퍼티

the name of the column where the user who created the entry is stored
public $createdByColumn

$generateHintsFromComments 공개적으로 프로퍼티

This indicates whether the generator should generate attribute hints by using the comments of the corresponding DB columns
public $generateHintsFromComments

$generateModelClass 공개적으로 프로퍼티

whether to overwrite (extended) model classes, will be always created, if file does not exist
public $generateModelClass

$languageCodeColumn 공개적으로 프로퍼티

the column name where the language code is stored
public $languageCodeColumn

$languageTableName 공개적으로 프로퍼티

the name of the table containing the translations. {{table}} will be replaced with the value in "Table Name" field
public $languageTableName

$messageCategory 공개적으로 프로퍼티

public $messageCategory

$removeDuplicateRelations 공개적으로 프로퍼티

public $removeDuplicateRelations

$savedForm 공개적으로 프로퍼티

form field for selecting and loading saved gii forms
public $savedForm

$singularEntities 공개적으로 프로퍼티

public $singularEntities

$tableNameMap 공개적으로 프로퍼티

key-value pairs for mapping a table-name to class-name, eg. 'prefix_FOObar' => 'FooBar'
public $tableNameMap

$tablePrefix 공개적으로 프로퍼티

string for the table prefix, which is ignored in generated class name
public $tablePrefix

$updatedAtColumn 공개적으로 프로퍼티

the name of the column where the user who updated the entry is stored
public $updatedAtColumn

$updatedByColumn 공개적으로 프로퍼티

the name of the column where the user who updated the entry is stored
public $updatedByColumn

$useBlameableBehavior 공개적으로 프로퍼티

whether or not to use BlameableBehavior
public $useBlameableBehavior

$useTimestampBehavior 공개적으로 프로퍼티

whether or not to use TimestampBehavior
public $useTimestampBehavior

$useTranslatableBehavior 공개적으로 프로퍼티

whether or not to use 2amigos/yii2-translateable-behavior
public $useTranslatableBehavior