PHP Class jamband\schemadump\SchemaDumpController

Inheritance: extends yii\console\Controller
Show file Open project: jamband/yii2-schemadump

Public Properties

Property Type Description
$db the DB connection object or the application component ID of the DB connection.
$defaultAction
$migrationTable a migration table name

Public Methods

Method Description
actionCreate ( string $schema = '' ) : integer Generates the 'createTable' code.
actionDrop ( string $schema = '' ) : integer Generates the 'dropTable' code.
beforeAction ( $action )
options ( $actionID )

Private Methods

Method Description
getColumnsDefinition ( array $columns ) : string Returns the columns definition.
getForeignKeyDefinition ( TableSchema[] $table ) : string | null Returns the foreign key definition.
getPrimaryKeyDefinition ( array $pk, string $stdout, integer $offset ) : string | null Returns the primary key definition.
getSchemaType ( ColumnSchema[] $column ) : string Returns the schema type.
otherDefinition ( ColumnSchema[] $column ) : string Returns the other definition.
type ( string $type ) : string Returns the constant strings of yii\db\Schema class. e.g. Schema::TYPE_PK

Method Details

actionCreate() public method

Generates the 'createTable' code.
public actionCreate ( string $schema = '' ) : integer
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema name.
return integer the status of the action execution

actionDrop() public method

Generates the 'dropTable' code.
public actionDrop ( string $schema = '' ) : integer
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema name.
return integer the status of the action execution

beforeAction() public method

public beforeAction ( $action )

options() public method

public options ( $actionID )

Property Details

$db public property

the DB connection object or the application component ID of the DB connection.
public $db

$defaultAction public property

public $defaultAction

$migrationTable public property

a migration table name
public $migrationTable