PHP Class yii\db\mssql\QueryBuilder

Since: 2.0
Author: Timur Ruziev ([email protected])
Inheritance: extends yii\db\QueryBuilder
Afficher le fichier Open project: yiisoft/yii2

Méthodes publiques

Свойство Type Description
$typeMap mapping from abstract column types (keys) to physical column types (values).

Méthodes publiques

Méthode Description
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 )

Méthodes protégées

Méthode Description
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.

Method Details

addCommentOnColumn() public méthode

Since: 2.0.8
public addCommentOnColumn ( $table, $column, $comment )

addCommentOnTable() public méthode

Since: 2.0.8
public addCommentOnTable ( $table, $comment )

alterColumn() public méthode

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'.
Résultat string the SQL statement for changing the definition of a column.

buildCompositeInCondition() protected méthode

Builds SQL for IN condition
protected buildCompositeInCondition ( string $operator, array $columns, array $values, array &$params ) : string
$operator string
$columns array
$values array
$params array
Résultat string SQL

buildOrderByAndLimit() public méthode

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

buildSubqueryInCondition() protected méthode

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

checkIntegrity() public méthode

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.
Résultat string the SQL statement for checking integrity

dropCommentFromColumn() public méthode

Since: 2.0.8
public dropCommentFromColumn ( $table, $column )

dropCommentFromTable() public méthode

Since: 2.0.8
public dropCommentFromTable ( $table )

getAllColumnNames() protected méthode

Returns an array of column names given model name
protected getAllColumnNames ( string $modelClass = null ) : array | null
$modelClass string name of the model class
Résultat array | null array of column names

isOldMssql() protected méthode

protected isOldMssql ( ) : boolean
Résultat boolean whether the version of the MSSQL being used is older than 2012.

newBuildOrderByAndLimit() protected méthode

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.
Résultat string the SQL completed with ORDER BY/LIMIT/OFFSET (if any)

oldBuildOrderByAndLimit() protected méthode

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.
Résultat string the SQL completed with ORDER BY/LIMIT/OFFSET (if any)

renameColumn() public méthode

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.
Résultat string the SQL statement for renaming a DB column.

renameTable() public méthode

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.
Résultat string the SQL statement for renaming a DB table.

selectExists() public méthode

Since: 2.0.8
public selectExists ( $rawSql )

Property Details

$typeMap public_oe property

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