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

С версии: 2.0
Автор: Timur Ruziev ([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 )
alterColumn ( string $table, string $column, string $type ) : string Builds a SQL statement for changing the definition of a column.
buildOrderByAndLimit ( $sql, $orderBy, $limit, $offset )
checkIntegrity ( boolean $check = true, string $schema = '', string $table = '' ) : string Builds a SQL statement for enabling or disabling integrity check.
dropCommentFromColumn ( $table, $column )
dropCommentFromTable ( $table )
renameColumn ( string $table, string $oldName, string $newName ) : string Builds a SQL statement for renaming a column.
renameTable ( string $oldName, string $newName ) : string Builds a SQL statement for renaming a DB table.
selectExists ( $rawSql )

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

Метод Описание
buildCompositeInCondition ( string $operator, array $columns, array $values, array &$params ) : string Builds SQL for IN condition
buildSubqueryInCondition ( $operator, $columns, $values, &$params )
getAllColumnNames ( string $modelClass = null ) : array | null Returns an array of column names given model name
isOldMssql ( ) : boolean
newBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2012 or newer.
oldBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2005 to 2008.

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

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

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

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

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

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

Builds a SQL statement for changing the definition of a column.
public alterColumn ( string $table, string $column, string $type ) : string
$table string the table whose column is to be changed. The table name will be properly quoted by the method.
$column string the name of the column to be changed. The name will be properly quoted by the method.
$type string the new column type. The [[getColumnType]] method will be invoked to convert abstract column type (if any) into the physical one. Anything that is not recognized as abstract type will be kept in the generated SQL. For example, 'string' will be turned into 'varchar(255)', while 'string not null' will become 'varchar(255) not null'.
Результат string the SQL statement for changing the definition of a column.

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

Builds SQL for IN condition
protected buildCompositeInCondition ( string $operator, array $columns, array $values, array &$params ) : string
$operator string
$columns array
$values array
$params array
Результат string SQL

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

public buildOrderByAndLimit ( $sql, $orderBy, $limit, $offset )

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

protected buildSubqueryInCondition ( $operator, $columns, $values, &$params )

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. Defaults to empty string, meaning the current or default schema.
$table string the table name. Defaults to empty string, meaning that no table will be changed.
Результат string the SQL statement for checking integrity

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

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

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

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

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

Returns an array of column names given model name
protected getAllColumnNames ( string $modelClass = null ) : array | null
$modelClass string name of the model class
Результат array | null array of column names

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

protected isOldMssql ( ) : boolean
Результат boolean whether the version of the MSSQL being used is older than 2012.

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

Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2012 or newer.
protected newBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string
$sql string the existing SQL (without ORDER BY/LIMIT/OFFSET)
$orderBy array the order by columns. See [[\yii\db\Query::orderBy]] for more details on how to specify this parameter.
$limit integer the limit number. See [[\yii\db\Query::limit]] for more details.
$offset integer the offset number. See [[\yii\db\Query::offset]] for more details.
Результат string the SQL completed with ORDER BY/LIMIT/OFFSET (if any)

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

Builds the ORDER BY/LIMIT/OFFSET clauses for SQL SERVER 2005 to 2008.
protected oldBuildOrderByAndLimit ( string $sql, array $orderBy, integer $limit, integer $offset ) : string
$sql string the existing SQL (without ORDER BY/LIMIT/OFFSET)
$orderBy array the order by columns. See [[\yii\db\Query::orderBy]] for more details on how to specify this parameter.
$limit integer the limit number. See [[\yii\db\Query::limit]] for more details.
$offset integer the offset number. See [[\yii\db\Query::offset]] for more details.
Результат string the SQL completed with ORDER BY/LIMIT/OFFSET (if any)

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.

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

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

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

С версии: 2.0.8
public selectExists ( $rawSql )

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

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

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