PHP Class mootensai\enhancedgii\migration\Generator

Since: 1.1
Author: Misbahul D Munir ([email protected])
Inheritance: extends yii\gii\Generator
Show file Open project: mootensai/yii2-enhanced-gii

Public Properties

Property Type Description
$db
$generateRelations
$migrationName
$migrationPath
$migrationTime
$tableName
$useTablePrefix

Protected Properties

Property Type Description
$constans
$tableNames

Public Methods

Method Description
attributeLabels ( )
autoCompleteData ( )
generate ( )
generateTableName ( string $tableName ) : string Generates the table name by considering table prefix.
getDescription ( )
getName ( )
getSchemaType ( ColumnSchema $column ) : array
hints ( )
init ( )
requiredTemplates ( )
rules ( )
stickyAttributes ( )
validateDb ( ) Validates the [[db]] attribute.
validateTableName ( ) Validates the [[tableName]] attribute.

Protected Methods

Method Description
generateColumns ( yii\db\TableSchema $table ) : array Generates validation rules for the specified table.
generateRelations ( ) : array
getDbConnection ( ) : Connection
getTableNames ( ) : array
reorderRecrusive ( array $tableNames, array &$depencies, array &$orders )
reorderTables ( array $tables, array $relations ) : array Reorder tables acourding with dependencies.

Method Details

attributeLabels() public method

public attributeLabels ( )

autoCompleteData() public method

public autoCompleteData ( )

generate() public method

public generate ( )

generateColumns() protected method

Generates validation rules for the specified table.
protected generateColumns ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table schema
return array the generated validation rules

generateRelations() protected method

protected generateRelations ( ) : array
return array the generated relation declarations

generateTableName() public method

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)
return string the generated table name

getDbConnection() protected method

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

getDescription() public method

public getDescription ( )

getName() public method

public getName ( )

getSchemaType() public method

public getSchemaType ( ColumnSchema $column ) : array
$column yii\db\ColumnSchema
return array

getTableNames() protected method

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

hints() public method

public hints ( )

init() public method

public init ( )

reorderRecrusive() protected method

protected reorderRecrusive ( array $tableNames, array &$depencies, array &$orders )
$tableNames array
$depencies array
$orders array

reorderTables() protected method

Reorder tables acourding with dependencies.
protected reorderTables ( array $tables, array $relations ) : array
$tables array
$relations array
return array

requiredTemplates() public method

public requiredTemplates ( )

rules() public method

public rules ( )

stickyAttributes() public method

public stickyAttributes ( )

validateDb() public method

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

validateTableName() public method

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

Property Details

$constans protected property

protected $constans

$db public property

public $db

$generateRelations public property

public $generateRelations

$migrationName public property

public $migrationName

$migrationPath public property

public $migrationPath

$migrationTime public property

public $migrationTime

$tableName public property

public $tableName

$tableNames protected property

protected $tableNames

$useTablePrefix public property

public $useTablePrefix