PHP Класс mootensai\enhancedgii\BaseGenerator

Наследование: extends yii\gii\Generator
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$baseModelClass
$db
$modelClass
$nsModel
$nsSearchModel
$skippedRelations
$tableName
$tableSchema * @var $tableSchema TableSchema
$useSchemaName

Защищенные свойства (Protected)

Свойство Тип Описание
$classNames
$tableNames

Открытые методы

Метод Описание
autoCompleteData ( )
generateTableName ( string $tableName ) : string Generates the table name by considering table prefix.
getColumnNames ( ) : integer[]
getDbConnection ( ) : Connection
getTableSchema ( )
getTreeColumns ( )
validateDb ( ) Validates the [[db]] attribute.
validateModelClass ( ) Checks if model class is valid
validateTableName ( ) Validates the [[tableName]] attribute.

Защищенные методы

Метод Описание
addInverseRelations ( array $relations ) : array Adds inverse relations
checkPivotTable ( yii\db\TableSchema $table ) : array | boolean Checks if the given table is a junction table.
generateClassName ( string $tableName, boolean $useSchemaName = null ) : string Generates a class name from the specified table 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
getSchemaNames ( ) : string[]
getTableNames ( ) : array
isHasManyRelation ( yii\db\TableSchema $table, array $fks ) : boolean Determines if relation is of has many type

Приватные методы

Метод Описание
generateManyManyRelations ( yii\db\TableSchema $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

autoCompleteData() публичный Метод

public autoCompleteData ( )

checkPivotTable() защищенный Метод

For simplicity, this method only deals with the case where the pivot contains two PK columns, each referencing a column in a different table.
protected checkPivotTable ( yii\db\TableSchema $table ) : array | boolean
$table yii\db\TableSchema
Результат array | boolean the relevant foreign key constraint information if the table is a junction table, or false if the table is not a junction table.

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

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

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

getColumnNames() публичный Метод

public getColumnNames ( ) : integer[]
Результат integer[] model column names

getDbConnection() публичный Метод

public getDbConnection ( ) : Connection
Результат yii\db\Connection the DB connection as specified by [[db]].

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]].

getTableSchema() публичный Метод

public getTableSchema ( )

getTreeColumns() публичный статический Метод

public static getTreeColumns ( )

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

validateDb() публичный Метод

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

validateModelClass() публичный Метод

Checks if model class is valid
public validateModelClass ( )

validateTableName() публичный Метод

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

Описание свойств

$baseModelClass публичное свойство

public $baseModelClass

$classNames защищенное свойство

protected $classNames

$db публичное свойство

public $db

$modelClass публичное свойство

public $modelClass

$nsModel публичное свойство

public $nsModel

$nsSearchModel публичное свойство

public $nsSearchModel

$skippedRelations публичное свойство

public $skippedRelations

$tableName публичное свойство

public $tableName

$tableNames защищенное свойство

protected $tableNames

$tableSchema публичное свойство

* @var $tableSchema TableSchema
public $tableSchema

$useSchemaName публичное свойство

public $useSchemaName