PHP Класс schmunk42\giiant\generators\model\Generator

С версии: 0.0.1
Автор: Tobias Munk ([email protected])
Наследование: extends yii\gii\generators\model\Generator
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$baseClassSuffix suffix to append to the base model, setting "Base" will result in a model named "PostBase"
$baseTraits base-traits
$createdAtColumn the name of the column where the user who updated the entry is stored
$createdByColumn the name of the column where the user who created the entry is stored
$generateHintsFromComments This indicates whether the generator should generate attribute hints by using the comments of the corresponding DB columns
$generateModelClass whether to overwrite (extended) model classes, will be always created, if file does not exist
$languageCodeColumn the column name where the language code is stored
$languageTableName the name of the table containing the translations. {{table}} will be replaced with the value in "Table Name" field
$messageCategory
$removeDuplicateRelations
$savedForm form field for selecting and loading saved gii forms
$singularEntities
$tableNameMap key-value pairs for mapping a table-name to class-name, eg. 'prefix_FOObar' => 'FooBar'
$tablePrefix string for the table prefix, which is ignored in generated class name
$updatedAtColumn the name of the column where the user who updated the entry is stored
$updatedByColumn the name of the column where the user who updated the entry is stored
$useBlameableBehavior whether or not to use BlameableBehavior
$useTimestampBehavior whether or not to use TimestampBehavior
$useTranslatableBehavior whether or not to use 2amigos/yii2-translateable-behavior

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

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

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

Метод Описание
attributeLabels ( )
formAttributes ( ) : array all form fields for saving in saved forms.
generate ( )
generateClassName ( string $tableName, $useSchemaName = null ) : string Generates a class name from the specified table name.
generateHints ( yii\db\TableSchema $table ) : array Generates the attribute hints for the specified table.
generateRelationName ( $relations, $table, $key, $multiple )
generateRules ( yii\db\TableSchema $table ) : array Generates validation rules for the specified table and add enum value validation.
getDescription ( )
getEnum ( array $columns ) : array prepare ENUM field values.
getName ( )
getTableNames ( )
hints ( )
isEnum ( $column ) : type validate is ENUM.
requiredTemplates ( )
rules ( )
validateDb ( ) Validates the [[db]] attribute.

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

Метод Описание
extractTranslations ( $tableName, $relations ) : array
generateBlameable ( yii\db\TableSchema $table ) : string[]
generateRelations ( )
generateTimestamp ( yii\db\TableSchema $table ) : string[]
getDbConnection ( ) : Connection

Описание методов

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

public attributeLabels ( )

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

protected extractTranslations ( $tableName, $relations ) : array
$relations all database's relations
Результат array associative array containing the extracted relations and the modified translations

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

all form fields for saving in saved forms.
public formAttributes ( ) : array
Результат array

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

public generate ( )

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

protected generateBlameable ( yii\db\TableSchema $table ) : string[]
$table yii\db\TableSchema the table schema
Результат string[]

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

Generates a class name from the specified table name.
public generateClassName ( string $tableName, $useSchemaName = null ) : string
$tableName string the table name (which may contain schema prefix)
Результат string the generated class name

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

Generates the attribute hints for the specified table.
public generateHints ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table schema
Результат array the generated attribute hints (name => hint) or an empty array if $this->generateHintsFromComments is false

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

public generateRelationName ( $relations, $table, $key, $multiple )

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

protected generateRelations ( )

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

Generates validation rules for the specified table and add enum value validation.
public generateRules ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table schema
Результат array the generated validation rules

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

protected generateTimestamp ( yii\db\TableSchema $table ) : string[]
$table yii\db\TableSchema the table schema
Результат string[]

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

protected getDbConnection ( ) : Connection
Результат yii\db\Connection the DB connection from the DI container or as application component specified by [[db]]

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

public getDescription ( )

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

prepare ENUM field values.
public getEnum ( array $columns ) : array
$columns array
Результат array

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

public getName ( )

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

public getTableNames ( )

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

public hints ( )

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

validate is ENUM.
public isEnum ( $column ) : type
$column table column
Результат type

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

public requiredTemplates ( )

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

public rules ( )

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

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

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

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

suffix to append to the base model, setting "Base" will result in a model named "PostBase"
public $baseClassSuffix

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

base-traits
public $baseTraits

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

protected $classNames2

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

the name of the column where the user who updated the entry is stored
public $createdAtColumn

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

the name of the column where the user who created the entry is stored
public $createdByColumn

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

This indicates whether the generator should generate attribute hints by using the comments of the corresponding DB columns
public $generateHintsFromComments

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

whether to overwrite (extended) model classes, will be always created, if file does not exist
public $generateModelClass

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

the column name where the language code is stored
public $languageCodeColumn

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

the name of the table containing the translations. {{table}} will be replaced with the value in "Table Name" field
public $languageTableName

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

public $messageCategory

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

public $removeDuplicateRelations

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

form field for selecting and loading saved gii forms
public $savedForm

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

public $singularEntities

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

key-value pairs for mapping a table-name to class-name, eg. 'prefix_FOObar' => 'FooBar'
public $tableNameMap

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

string for the table prefix, which is ignored in generated class name
public $tablePrefix

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

the name of the column where the user who updated the entry is stored
public $updatedAtColumn

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

the name of the column where the user who updated the entry is stored
public $updatedByColumn

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

whether or not to use BlameableBehavior
public $useBlameableBehavior

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

whether or not to use TimestampBehavior
public $useTimestampBehavior

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

whether or not to use 2amigos/yii2-translateable-behavior
public $useTranslatableBehavior