Property | Type | Description | |
---|---|---|---|
$classNames | |||
$tableNames |
Method | Description | |
---|---|---|
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. |
Method | Description | |
---|---|---|
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 ( ) : |
||
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 |
Method | Description | |
---|---|---|
generateManyManyRelations ( $table, array $fks, array $relations ) : array | Generates relations using a junction table by adding an extra viaTable(). |
protected addInverseRelations ( array $relations ) : array | ||
$relations | array | relation declarations |
return | array | relation declarations extended with inverse relation names |
protected checkJunctionTable ( $table ) : array | boolean | ||
return | array | boolean | all unique foreign key pairs if the table is a junction table, or false if the table is not a junction table. |
public generateLabels ( yii\db\TableSchema $table ) : array | ||
$table | yii\db\TableSchema | the table schema |
return | array | the generated attribute labels (name => label) |
protected generateQueryClassName ( string $modelClassName ) : string | ||
$modelClassName | string | model class name |
return | string | generated class name |
protected generateRelationLink ( array $refs ) : string | ||
$refs | array | reference constraint |
return | string | the generated link parameter. |
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 |
return | string | the relation name |
protected generateRelations ( ) : array | ||
return | array | the generated relation declarations |
public generateRules ( yii\db\TableSchema $table ) : array | ||
$table | yii\db\TableSchema | the table schema |
return | array | the generated validation rules |
public generateTableName ( string $tableName ) : string | ||
$tableName | string | the table name (which may contain schema prefix) |
return | string | the generated table name |
protected getDbConnection ( ) : |
||
return | the DB connection as specified by [[db]]. |
protected getSchemaNames ( ) : string[] | ||
return | string[] | all db schema names or an array with a single empty string |
protected getTableNames ( ) : array | ||
return | array | the table names that match the pattern specified by [[tableName]]. |
public getTablePrefix ( ) : string | ||
return | string |
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. |
protected isHasManyRelation ( yii\db\TableSchema $table, array $fks ) : boolean | ||
$table | yii\db\TableSchema | |
$fks | array | |
return | boolean |
public validateModelClass ( ) |
public validateNamespace ( string $attribute ) | ||
$attribute | string | Namespace variable. |
public validateTableName ( ) |