PHP Class luya\console\commands\BaseCrudController

As we can not ensure to access the gii model generate class we have to copy the base of the class, check the see section.
See also: https://github.com/yiisoft/yii2-gii/blob/master/generators/model/Generator.php
Author: Basil Suter ([email protected])
Inheritance: extends luya\console\Command
Show file Open project: luyadev/luya

Public Properties

Property Type Description
$generateLabelsFromComments Whether to generate labels from comments or not.
$tableName The name of the table.
$useSchemaName Whether to use schem name or not

Protected Properties

Property Type Description
$classNames A list of class names.
$tableNames A list of table names.

Public Methods

Method Description
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.
getSqlTablesArray ( ) : array Get the sql tables from the current database connection

Protected Methods

Method Description
generateClassName ( string $tableName, boolean $useSchemaName = null ) : string Generates a class name from the specified table name.
getDbConnection ( ) : Connection
isColumnAutoIncremental ( yii\db\TableSchema $table, array $columns ) : boolean Checks if any of the specified columns is auto incremental.

Method Details

generateClassName() protected method

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

generateLabels() public method

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

generateRules() public method

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

getDbConnection() protected method

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

getSqlTablesArray() public method

Get the sql tables from the current database connection
public getSqlTablesArray ( ) : array
return array An array with all sql tables.

isColumnAutoIncremental() protected method

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
return boolean whether any of the specified columns is auto incremental.

Property Details

$classNames protected property

A list of class names.
protected $classNames

$generateLabelsFromComments public property

Whether to generate labels from comments or not.
public $generateLabelsFromComments

$tableName public property

The name of the table.
public $tableName

$tableNames protected property

A list of table names.
protected $tableNames

$useSchemaName public property

Whether to use schem name or not
public $useSchemaName