PHP Класс yii\db\mysql\Schema

С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\db\Schema
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$typeMap mapping from physical column types (keys) to abstract column types (values)

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

Метод Описание
createColumnSchemaBuilder ( $type, $length = null )
createQueryBuilder ( ) : QueryBuilder Creates a query builder for the MySQL database.
findUniqueIndexes ( yii\db\TableSchema $table ) : array Returns all unique indexes for the given table.
quoteSimpleColumnName ( string $name ) : string Quotes a column name for use in a query.
quoteSimpleTableName ( string $name ) : string Quotes a table name for use in a query.

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

Метод Описание
findColumns ( yii\db\TableSchema $table ) : boolean Collects the metadata of table columns.
findConstraints ( yii\db\TableSchema $table ) Collects the foreign key column details for the given table.
findTableNames ( string $schema = '' ) : array Returns all table names in the database.
getCreateTableSql ( yii\db\TableSchema $table ) : string Gets the CREATE TABLE sql string.
loadColumnSchema ( array $info ) : ColumnSchema Loads the column information into a [[ColumnSchema]] object.
loadTableSchema ( string $name ) : yii\db\TableSchema Loads the metadata for the specified table.
resolveTableNames ( yii\db\TableSchema $table, string $name ) Resolves the table name and schema name (if any).

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

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

public createColumnSchemaBuilder ( $type, $length = null )

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

Creates a query builder for the MySQL database.
public createQueryBuilder ( ) : QueryBuilder
Результат QueryBuilder query builder instance

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

Collects the metadata of table columns.
protected findColumns ( yii\db\TableSchema $table ) : boolean
$table yii\db\TableSchema the table metadata
Результат boolean whether the table exists in the database

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

Collects the foreign key column details for the given table.
protected findConstraints ( yii\db\TableSchema $table )
$table yii\db\TableSchema the table metadata

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

Returns all table names in the database.
protected findTableNames ( string $schema = '' ) : array
$schema string the schema of the tables. Defaults to empty string, meaning the current or default schema.
Результат array all table names in the database. The names have NO schema name prefix.

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

Each array element is of the following structure: php [ 'IndexName1' => ['col1' [, ...]], 'IndexName2' => ['col2' [, ...]], ]
public findUniqueIndexes ( yii\db\TableSchema $table ) : array
$table yii\db\TableSchema the table metadata
Результат array all unique indexes for the given table.

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

Gets the CREATE TABLE sql string.
protected getCreateTableSql ( yii\db\TableSchema $table ) : string
$table yii\db\TableSchema the table metadata
Результат string $sql the result of 'SHOW CREATE TABLE'

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

Loads the column information into a [[ColumnSchema]] object.
protected loadColumnSchema ( array $info ) : ColumnSchema
$info array column information
Результат yii\db\ColumnSchema the column schema object

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

Loads the metadata for the specified table.
protected loadTableSchema ( string $name ) : yii\db\TableSchema
$name string table name
Результат yii\db\TableSchema driver dependent table metadata. Null if the table does not exist.

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

A simple column name has no prefix.
public quoteSimpleColumnName ( string $name ) : string
$name string column name
Результат string the properly quoted column name

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

A simple table name has no schema prefix.
public quoteSimpleTableName ( string $name ) : string
$name string table name
Результат string the properly quoted table name

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

Resolves the table name and schema name (if any).
protected resolveTableNames ( yii\db\TableSchema $table, string $name )
$table yii\db\TableSchema the table metadata object
$name string the table name

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

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

mapping from physical column types (keys) to abstract column types (values)
public $typeMap