PHP Class Doctrine\DBAL\Platforms\MySqlPlatform

Since: 2.0
Author: Roman Borschel ([email protected])
Inheritance: extends Doctrine\DBAL\Platforms\AbstractPlatform
Afficher le fichier Open project: doctrine/dbal Class Usage Examples

Méthodes publiques

Méthode Description
getAdvancedForeignKeyOptionsSQL ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey ) {@inheritDoc}
getAlterTableSQL ( Doctrine\DBAL\Schema\TableDiff $diff ) {@inheritDoc}
getBigIntTypeDeclarationSQL ( array $field ) {@inheritDoc}
getBinaryMaxLength ( )
getBlobTypeDeclarationSQL ( array $field ) : string Gets the SQL Snippet used to declare a BLOB column type.
getBooleanTypeDeclarationSQL ( array $field ) {@inheritDoc}
getClobTypeDeclarationSQL ( array $field ) : string Gets the SQL snippet used to declare a CLOB column type.
getCollationFieldDeclaration ( string $collation ) : string Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.
getConcatExpression ( ) {@inheritDoc}
getCreateDatabaseSQL ( $name ) {@inheritDoc}
getCreateViewSQL ( $name, $sql ) {@inheritDoc}
getDateDiffExpression ( $date1, $date2 ) {@inheritDoc}
getDateTimeTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getDateTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getDecimalTypeDeclarationSQL ( array $columnDef )
getDefaultValueDeclarationSQL ( $field )
getDropDatabaseSQL ( $name ) {@inheritDoc}
getDropIndexSQL ( $index, $table = null ) {@inheritDoc}
getDropTemporaryTableSQL ( $table ) {@inheritDoc}
getDropViewSQL ( $name ) {@inheritDoc}
getFloatDeclarationSQL ( array $field )
getGuidExpression ( ) {@inheritDoc}
getIdentifierQuoteCharacter ( ) {@inheritDoc}
getIntegerTypeDeclarationSQL ( array $field ) {@inheritDoc}
getListDatabasesSQL ( ) {@inheritDoc}
getListTableColumnsSQL ( $table, $database = null ) {@inheritDoc}
getListTableConstraintsSQL ( $table ) {@inheritDoc}
getListTableForeignKeysSQL ( $table, $database = null ) {@inheritDoc}
getListTableIndexesSQL ( $table, $currentDatabase = null ) {@inheritDoc}
getListTablesSQL ( ) {@inheritDoc}
getListViewsSQL ( $database ) {@inheritDoc}
getLocateExpression ( $str, $substr, $startPos = false ) {@inheritDoc}
getName ( ) {@inheritDoc}
getReadLockSQL ( ) {@inheritDoc}
getRegexpExpression ( ) {@inheritDoc}
getSetTransactionIsolationSQL ( $level ) {@inheritDoc}
getSmallIntTypeDeclarationSQL ( array $field ) {@inheritDoc}
getTimeTypeDeclarationSQL ( array $fieldDeclaration ) {@inheritDoc}
getVarcharMaxLength ( ) {@inheritDoc}
prefersIdentityColumns ( ) {@inheritDoc}
quoteStringLiteral ( $str )
supportsColumnCollation ( ) {@inheritDoc}
supportsIdentityColumns ( ) {@inheritDoc}
supportsInlineColumnComments ( ) {@inheritDoc}

Méthodes protégées

Méthode Description
_getCommonIntegerTypeDeclarationSQL ( array $columnDef ) {@inheritDoc}
_getCreateTableSQL ( $tableName, array $columns, array $options = [] ) {@inheritDoc}
doModifyLimitQuery ( string $query, integer $limit, integer $offset ) : string Adds MySQL-specific LIMIT clause to the query 18446744073709551615 is 2^64-1 maximum of unsigned BIGINT the biggest limit possible
getBinaryTypeDeclarationSQLSnippet ( $length, $fixed )
getCreateIndexSQLFlags ( Doctrine\DBAL\Schema\Index $index ) {@inheritDoc}
getDateArithmeticIntervalExpression ( $date, $operator, $interval, $unit )
getDropPrimaryKeySQL ( string $table ) : string
getPostAlterTableIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff )
getPostAlterTableRenameIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff ) : array
getPreAlterTableIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff ) {@inheritDoc}
getPreAlterTableRenameIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff ) : array
getReservedKeywordsClass ( ) {@inheritDoc}
getVarcharTypeDeclarationSQLSnippet ( $length, $fixed ) {@inheritDoc}
initializeDoctrineTypeMappings ( ) {@inheritDoc}

Private Methods

Méthode Description
buildPartitionOptions ( array $options ) : string Build SQL for partition options.
buildTableOptions ( array $options ) : string Build SQL for table options
getPreAlterTableAlterIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff ) : array
getPreAlterTableAlterPrimaryKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff, Doctrine\DBAL\Schema\Index $index ) : string[]
getRemainingForeignKeyConstraintsRequiringRenamedIndexes ( Doctrine\DBAL\Schema\TableDiff $diff ) : array Returns the remaining foreign key constraints that require one of the renamed indexes.
getUnsignedDeclaration ( array $columnDef ) : string Get unsigned declaration for a column.

Method Details

_getCommonIntegerTypeDeclarationSQL() protected méthode

{@inheritDoc}
protected _getCommonIntegerTypeDeclarationSQL ( array $columnDef )
$columnDef array

_getCreateTableSQL() protected méthode

{@inheritDoc}
protected _getCreateTableSQL ( $tableName, array $columns, array $options = [] )
$columns array
$options array

doModifyLimitQuery() protected méthode

Adds MySQL-specific LIMIT clause to the query 18446744073709551615 is 2^64-1 maximum of unsigned BIGINT the biggest limit possible
protected doModifyLimitQuery ( string $query, integer $limit, integer $offset ) : string
$query string
$limit integer
$offset integer
Résultat string

getAdvancedForeignKeyOptionsSQL() public méthode

{@inheritDoc}
public getAdvancedForeignKeyOptionsSQL ( Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey )
$foreignKey Doctrine\DBAL\Schema\ForeignKeyConstraint

getAlterTableSQL() public méthode

{@inheritDoc}
public getAlterTableSQL ( Doctrine\DBAL\Schema\TableDiff $diff )
$diff Doctrine\DBAL\Schema\TableDiff

getBigIntTypeDeclarationSQL() public méthode

{@inheritDoc}
public getBigIntTypeDeclarationSQL ( array $field )
$field array

getBinaryMaxLength() public méthode

public getBinaryMaxLength ( )

getBinaryTypeDeclarationSQLSnippet() protected méthode

protected getBinaryTypeDeclarationSQLSnippet ( $length, $fixed )

getBlobTypeDeclarationSQL() public méthode

TINYBLOB : 2 ^ 8 - 1 = 255 BLOB : 2 ^ 16 - 1 = 65535 MEDIUMBLOB : 2 ^ 24 - 1 = 16777215 LONGBLOB : 2 ^ 32 - 1 = 4294967295
public getBlobTypeDeclarationSQL ( array $field ) : string
$field array
Résultat string

getBooleanTypeDeclarationSQL() public méthode

{@inheritDoc}
public getBooleanTypeDeclarationSQL ( array $field )
$field array

getClobTypeDeclarationSQL() public méthode

TINYTEXT : 2 ^ 8 - 1 = 255 TEXT : 2 ^ 16 - 1 = 65535 MEDIUMTEXT : 2 ^ 24 - 1 = 16777215 LONGTEXT : 2 ^ 32 - 1 = 4294967295
public getClobTypeDeclarationSQL ( array $field ) : string
$field array
Résultat string

getCollationFieldDeclaration() public méthode

Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.
Deprecation: Deprecated since version 2.5, Use {@link self::getColumnCollationDeclarationSQL()} instead.
public getCollationFieldDeclaration ( string $collation ) : string
$collation string name of the collation
Résultat string DBMS specific SQL code portion needed to set the COLLATION of a field declaration.

getConcatExpression() public méthode

{@inheritDoc}
public getConcatExpression ( )

getCreateDatabaseSQL() public méthode

{@inheritDoc}
public getCreateDatabaseSQL ( $name )

getCreateIndexSQLFlags() protected méthode

{@inheritDoc}
protected getCreateIndexSQLFlags ( Doctrine\DBAL\Schema\Index $index )
$index Doctrine\DBAL\Schema\Index

getCreateViewSQL() public méthode

{@inheritDoc}
public getCreateViewSQL ( $name, $sql )

getDateArithmeticIntervalExpression() protected méthode

protected getDateArithmeticIntervalExpression ( $date, $operator, $interval, $unit )

getDateDiffExpression() public méthode

{@inheritDoc}
public getDateDiffExpression ( $date1, $date2 )

getDateTimeTypeDeclarationSQL() public méthode

{@inheritDoc}
public getDateTimeTypeDeclarationSQL ( array $fieldDeclaration )
$fieldDeclaration array

getDateTypeDeclarationSQL() public méthode

{@inheritDoc}
public getDateTypeDeclarationSQL ( array $fieldDeclaration )
$fieldDeclaration array

getDecimalTypeDeclarationSQL() public méthode

public getDecimalTypeDeclarationSQL ( array $columnDef )
$columnDef array

getDefaultValueDeclarationSQL() public méthode

public getDefaultValueDeclarationSQL ( $field )

getDropDatabaseSQL() public méthode

{@inheritDoc}
public getDropDatabaseSQL ( $name )

getDropIndexSQL() public méthode

{@inheritDoc}
public getDropIndexSQL ( $index, $table = null )

getDropPrimaryKeySQL() protected méthode

protected getDropPrimaryKeySQL ( string $table ) : string
$table string
Résultat string

getDropTemporaryTableSQL() public méthode

MySQL commits a transaction implicitly when DROP TABLE is executed, however not if DROP TEMPORARY TABLE is executed.
public getDropTemporaryTableSQL ( $table )

getDropViewSQL() public méthode

{@inheritDoc}
public getDropViewSQL ( $name )

getFloatDeclarationSQL() public méthode

public getFloatDeclarationSQL ( array $field )
$field array

getGuidExpression() public méthode

{@inheritDoc}
public getGuidExpression ( )

getIdentifierQuoteCharacter() public méthode

{@inheritDoc}

getIntegerTypeDeclarationSQL() public méthode

{@inheritDoc}
public getIntegerTypeDeclarationSQL ( array $field )
$field array

getListDatabasesSQL() public méthode

{@inheritDoc}
public getListDatabasesSQL ( )

getListTableColumnsSQL() public méthode

{@inheritDoc}
public getListTableColumnsSQL ( $table, $database = null )

getListTableConstraintsSQL() public méthode

{@inheritDoc}
public getListTableConstraintsSQL ( $table )

getListTableForeignKeysSQL() public méthode

{@inheritDoc}
public getListTableForeignKeysSQL ( $table, $database = null )

getListTableIndexesSQL() public méthode

Two approaches to listing the table indexes. The information_schema is preferred, because it doesn't cause problems with SQL keywords such as "order" or "table".
public getListTableIndexesSQL ( $table, $currentDatabase = null )

getListTablesSQL() public méthode

{@inheritDoc}
public getListTablesSQL ( )

getListViewsSQL() public méthode

{@inheritDoc}
public getListViewsSQL ( $database )

getLocateExpression() public méthode

{@inheritDoc}
public getLocateExpression ( $str, $substr, $startPos = false )

getName() public méthode

{@inheritDoc}
public getName ( )

getPostAlterTableIndexForeignKeySQL() protected méthode

protected getPostAlterTableIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff )
$diff Doctrine\DBAL\Schema\TableDiff

getPostAlterTableRenameIndexForeignKeySQL() protected méthode

protected getPostAlterTableRenameIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff ) : array
$diff Doctrine\DBAL\Schema\TableDiff The table diff to gather the SQL for.
Résultat array

getPreAlterTableIndexForeignKeySQL() protected méthode

{@inheritDoc}
protected getPreAlterTableIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff )
$diff Doctrine\DBAL\Schema\TableDiff

getPreAlterTableRenameIndexForeignKeySQL() protected méthode

protected getPreAlterTableRenameIndexForeignKeySQL ( Doctrine\DBAL\Schema\TableDiff $diff ) : array
$diff Doctrine\DBAL\Schema\TableDiff The table diff to gather the SQL for.
Résultat array

getReadLockSQL() public méthode

{@inheritDoc}
public getReadLockSQL ( )

getRegexpExpression() public méthode

{@inheritDoc}
public getRegexpExpression ( )

getReservedKeywordsClass() protected méthode

{@inheritDoc}
protected getReservedKeywordsClass ( )

getSetTransactionIsolationSQL() public méthode

{@inheritDoc}
public getSetTransactionIsolationSQL ( $level )

getSmallIntTypeDeclarationSQL() public méthode

{@inheritDoc}
public getSmallIntTypeDeclarationSQL ( array $field )
$field array

getTimeTypeDeclarationSQL() public méthode

{@inheritDoc}
public getTimeTypeDeclarationSQL ( array $fieldDeclaration )
$fieldDeclaration array

getVarcharMaxLength() public méthode

{@inheritDoc}
public getVarcharMaxLength ( )

getVarcharTypeDeclarationSQLSnippet() protected méthode

{@inheritDoc}
protected getVarcharTypeDeclarationSQLSnippet ( $length, $fixed )

initializeDoctrineTypeMappings() protected méthode

{@inheritDoc}

prefersIdentityColumns() public méthode

MySql prefers "autoincrement" identity columns since sequences can only be emulated with a table.

quoteStringLiteral() public méthode

public quoteStringLiteral ( $str )

supportsColumnCollation() public méthode

{@inheritDoc}

supportsIdentityColumns() public méthode

MySql supports this through AUTO_INCREMENT columns.

supportsInlineColumnComments() public méthode

{@inheritDoc}