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

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

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

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

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

Метод Описание
addCommentOnColumn ( $table, $column, $comment )
addCommentOnTable ( $table, $comment )
buildLimit ( $limit, $offset )
checkIntegrity ( boolean $check = true, string $schema = '', string $table = '' ) : string Builds a SQL statement for enabling or disabling integrity check.
createIndex ( $name, $table, $columns, $unique = false )
dropCommentFromColumn ( $table, $column )
dropCommentFromTable ( $table )
dropForeignKey ( string $name, string $table ) : string Builds a SQL statement for dropping a foreign key constraint.
dropPrimaryKey ( string $name, string $table ) : string Builds a SQL statement for removing a primary key constraint to an existing table.
insert ( $table, $columns, &$params )
renameColumn ( string $table, string $oldName, string $newName ) : string Builds a SQL statement for renaming a column.
resetSequence ( string $tableName, mixed $value = null ) : string Creates a SQL statement for resetting the sequence value of a table's primary key.

Приватные методы

Метод Описание
getColumnDefinition ( string $table, string $column ) : null | string Gets column definition.

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

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

С версии: 2.0.8
public addCommentOnColumn ( $table, $column, $comment )

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

С версии: 2.0.8
public addCommentOnTable ( $table, $comment )

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

public buildLimit ( $limit, $offset )

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

Builds a SQL statement for enabling or disabling integrity check.
public checkIntegrity ( boolean $check = true, string $schema = '', string $table = '' ) : string
$check boolean whether to turn on or off the integrity check.
$schema string the schema of the tables. Meaningless for MySQL.
$table string the table name. Meaningless for MySQL.
Результат string the SQL statement for checking integrity

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

См. также: https://bugs.mysql.com/bug.php?id=48875
public createIndex ( $name, $table, $columns, $unique = false )

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

С версии: 2.0.8
public dropCommentFromColumn ( $table, $column )

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

С версии: 2.0.8
public dropCommentFromTable ( $table )

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

Builds a SQL statement for dropping a foreign key constraint.
public dropForeignKey ( string $name, string $table ) : string
$name string the name of the foreign key constraint to be dropped. The name will be properly quoted by the method.
$table string the table whose foreign is to be dropped. The name will be properly quoted by the method.
Результат string the SQL statement for dropping a foreign key constraint.

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

Builds a SQL statement for removing a primary key constraint to an existing table.
public dropPrimaryKey ( string $name, string $table ) : string
$name string the name of the primary key constraint to be removed.
$table string the table that the primary key constraint will be removed from.
Результат string the SQL statement for removing a primary key constraint from an existing table.

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

public insert ( $table, $columns, &$params )

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

Builds a SQL statement for renaming a column.
public renameColumn ( string $table, string $oldName, string $newName ) : string
$table string the table whose column is to be renamed. The name will be properly quoted by the method.
$oldName string the old name of the column. The name will be properly quoted by the method.
$newName string the new name of the column. The name will be properly quoted by the method.
Результат string the SQL statement for renaming a DB column.

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

The sequence will be reset such that the primary key of the next new row inserted will have the specified value or 1.
public resetSequence ( string $tableName, mixed $value = null ) : string
$tableName string the name of the table whose primary key sequence will be reset
$value mixed the value for the primary key of the next new row inserted. If this is not set, the next new row's primary key will have a value 1.
Результат string the SQL statement for resetting sequence

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

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

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