PHP 클래스 yii\gii\generators\model\Generator

부터: 2.0
저자: Qiang Xue ([email protected])
상속: extends yii\gii\Generator
파일 보기 프로젝트 열기: yiisoft/yii2-gii 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$baseClass
$db
$generateLabelsFromComments
$generateQuery
$generateRelations
$generateRelationsFromCurrentSchema
$modelClass
$ns
$queryBaseClass
$queryClass
$queryNs
$tableName
$useSchemaName
$useTablePrefix

보호된 프로퍼티들

프로퍼티 타입 설명
$classNames
$tableNames

공개 메소드들

메소드 설명
attributeLabels ( )
autoCompleteData ( )
generate ( )
generateLabels ( yii\db\TableSchema $table ) : array Generates the attribute labels for the specified table.
generateRules ( yii\db\TableSchema $table ) : array Generates validation rules for the specified table.
generateTableName ( string $tableName ) : string Generates the table name by considering table prefix.
getDescription ( )
getName ( )
getTablePrefix ( ) : string Returns the tablePrefix property of the DB connection as specified
hints ( )
requiredTemplates ( )
rules ( )
stickyAttributes ( )
validateDb ( ) Validates the [[db]] attribute.
validateModelClass ( ) Validates the [[modelClass]] attribute.
validateNamespace ( string $attribute ) Validates the namespace.
validateTableName ( ) Validates the [[tableName]] attribute.

보호된 메소드들

메소드 설명
addInverseRelations ( array $relations ) : array Adds inverse relations
checkJunctionTable ( $table ) : array | boolean Checks if the given table is a junction table, that is it has at least one pair of unique foreign keys.
generateClassName ( string $tableName, boolean $useSchemaName = null ) : string Generates a class name from the specified table name.
generateQueryClassName ( string $modelClassName ) : string Generates a query class name from the specified model class name.
generateRelationLink ( array $refs ) : string Generates the link parameter to be used in generating the relation declaration.
generateRelationName ( array $relations, yii\db\TableSchema $table, string $key, boolean $multiple ) : string Generate a relation name for the specified table and a base name.
generateRelations ( ) : array
getDbConnection ( ) : Connection
getSchemaNames ( ) : string[]
getTableNames ( ) : array
isColumnAutoIncremental ( yii\db\TableSchema $table, array $columns ) : boolean Checks if any of the specified columns is auto incremental.
isHasManyRelation ( yii\db\TableSchema $table, array $fks ) : boolean Determines if relation is of has many type

비공개 메소드들

메소드 설명
generateManyManyRelations ( $table, array $fks, array $relations ) : array Generates relations using a junction table by adding an extra viaTable().

메소드 상세

addInverseRelations() 보호된 메소드

Adds inverse relations
부터: 2.0.5
protected addInverseRelations ( array $relations ) : array
$relations array relation declarations
리턴 array relation declarations extended with inverse relation names

attributeLabels() 공개 메소드

public attributeLabels ( )

autoCompleteData() 공개 메소드

public autoCompleteData ( )

checkJunctionTable() 보호된 메소드

Checks if the given table is a junction table, that is it has at least one pair of unique foreign keys.
protected checkJunctionTable ( $table ) : array | boolean
리턴 array | boolean all unique foreign key pairs if the table is a junction table, or false if the table is not a junction table.

generate() 공개 메소드

public generate ( )

generateClassName() 보호된 메소드

Generates a class name from the specified table name.
protected generateClassName ( string $tableName, boolean $useSchemaName = null ) : string
$tableName string the table name (which may contain schema prefix)
$useSchemaName boolean should schema name be included in the class name, if present
리턴 string the generated class name

generateLabels() 공개 메소드

Generates the attribute labels for the specified table.
public generateLabels ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table schema
리턴 array the generated attribute labels (name => label)

generateQueryClassName() 보호된 메소드

Generates a query class name from the specified model class name.
protected generateQueryClassName ( string $modelClassName ) : string
$modelClassName string model class name
리턴 string generated class name

generateRelationName() 보호된 메소드

Generate a relation name for the specified table and a base name.
protected generateRelationName ( array $relations, yii\db\TableSchema $table, string $key, boolean $multiple ) : string
$relations array the relations being generated currently.
$table yii\db\TableSchema the table schema
$key string a base name that the relation name may be generated from
$multiple boolean whether this is a has-many relation
리턴 string the relation name

generateRelations() 보호된 메소드

protected generateRelations ( ) : array
리턴 array the generated relation declarations

generateRules() 공개 메소드

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

generateTableName() 공개 메소드

If [[useTablePrefix]] is false, the table name will be returned without change.
public generateTableName ( string $tableName ) : string
$tableName string the table name (which may contain schema prefix)
리턴 string the generated table name

getDbConnection() 보호된 메소드

protected getDbConnection ( ) : Connection
리턴 yii\db\Connection the DB connection as specified by [[db]].

getDescription() 공개 메소드

public getDescription ( )

getName() 공개 메소드

public getName ( )

getSchemaNames() 보호된 메소드

부터: 2.0.5
protected getSchemaNames ( ) : string[]
리턴 string[] all db schema names or an array with a single empty string

getTableNames() 보호된 메소드

protected getTableNames ( ) : array
리턴 array the table names that match the pattern specified by [[tableName]].

getTablePrefix() 공개 메소드

Returns the tablePrefix property of the DB connection as specified
또한 보기: getDbConnection
부터: 2.0.5
public getTablePrefix ( ) : string
리턴 string

hints() 공개 메소드

public hints ( )

isColumnAutoIncremental() 보호된 메소드

Checks if any of the specified columns is auto incremental.
protected isColumnAutoIncremental ( yii\db\TableSchema $table, array $columns ) : boolean
$table yii\db\TableSchema the table schema
$columns array columns to check for autoIncrement property
리턴 boolean whether any of the specified columns is auto incremental.

isHasManyRelation() 보호된 메소드

Determines if relation is of has many type
부터: 2.0.5
protected isHasManyRelation ( yii\db\TableSchema $table, array $fks ) : boolean
$table yii\db\TableSchema
$fks array
리턴 boolean

requiredTemplates() 공개 메소드

public requiredTemplates ( )

rules() 공개 메소드

public rules ( )

stickyAttributes() 공개 메소드

public stickyAttributes ( )

validateDb() 공개 메소드

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

validateModelClass() 공개 메소드

Validates the [[modelClass]] attribute.
public validateModelClass ( )

validateNamespace() 공개 메소드

Validates the namespace.
public validateNamespace ( string $attribute )
$attribute string Namespace variable.

validateTableName() 공개 메소드

Validates the [[tableName]] attribute.
public validateTableName ( )

프로퍼티 상세

$baseClass 공개적으로 프로퍼티

public $baseClass

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

protected $classNames

$db 공개적으로 프로퍼티

public $db

$generateLabelsFromComments 공개적으로 프로퍼티

public $generateLabelsFromComments

$generateQuery 공개적으로 프로퍼티

public $generateQuery

$generateRelations 공개적으로 프로퍼티

public $generateRelations

$generateRelationsFromCurrentSchema 공개적으로 프로퍼티

public $generateRelationsFromCurrentSchema

$modelClass 공개적으로 프로퍼티

public $modelClass

$ns 공개적으로 프로퍼티

public $ns

$queryBaseClass 공개적으로 프로퍼티

public $queryBaseClass

$queryClass 공개적으로 프로퍼티

public $queryClass

$queryNs 공개적으로 프로퍼티

public $queryNs

$tableName 공개적으로 프로퍼티

public $tableName

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

protected $tableNames

$useSchemaName 공개적으로 프로퍼티

public $useSchemaName

$useTablePrefix 공개적으로 프로퍼티

public $useTablePrefix