Doctrine


Doctrine\DBAL\Platforms\AbstractPlatform
/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 47

Class AbstractPlatform

AbstractPlatform

public abstract class AbstractPlatform

Base class for all DatabasePlatforms. The DatabasePlatforms are the central point of abstraction of platform-specific behaviors, features and SQL dialects. They are a passive source of information.

License:
http://www.opensource.org/licenses/lgpl-license.php LGPL
See Also:
www.doctrine-project.org
Since:
2.0
Version:
$Revision: 3938 $
Author:
Guilherme Blanco
Jonathan Wage
Roman Borschel
Lukas Smith (PEAR MDB2 library)
Todo:
Remove any unnecessary methods.

Field Summary
final int

CREATE_FOREIGNKEYS

final int

CREATE_INDEXES

final int

TRIM_BOTH

final int

TRIM_LEADING

final int

TRIM_TRAILING

final int

$TRIM_UNSPECIFIED

Constructor Summary

AbstractPlatform()

Constructor.

Method Summary
void

convertBooleans(mixed item)

Some platforms need the boolean values to be converted.

bool

createsExplicitIndexForForeignKeys()

string

fixSchemaElementName(mixed schemaElementName, string schemaName)

Makes any fixes to a name of a schema element (table, sequence, ...) that are required by restrictions of the platform, like a maximum length.

void

getAcosExpression(mixed value)

string

getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint foreignKey)

Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...

array

getAlterTableSQL(TableDiff diff)

Gets the sql statements for altering an existing table.

string

getAvgExpression(string column)

Returns the average value of a column

string

getBetweenExpression(string expression, string value1, string value2)

Returns SQL that checks if an expression evaluates to a value between two values.

abstract string

getBigIntTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares an 8 byte integer column.

abstract string

getBooleanTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a boolean column.

string

getCheckDeclarationSQL(array definition)

Obtain DBMS specific SQL code portion needed to set a CHECK constraint declaration to be used in statements like CREATE TABLE.

abstract void

getClobTypeDeclarationSQL(array field)

Gets the SQL snippet used to declare a CLOB column type.

string

getColumnCharsetDeclarationSQL(string charset)

Obtain DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration to be used in statements like CREATE TABLE.

string

getColumnCollationDeclarationSQL(string collation)

Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.

string

getColumnDeclarationListSQL(array fields)

Get declaration of a number of fields in bulk

string

getColumnDeclarationSQL(string name, array field)

Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE.

string

getConcatExpression(string arg1,)

Returns a series of strings concatinatedconcat() accepts an arbitrary number of parameters.

void

getCosExpression(mixed value)

string

getCountExpression(string|integer column)

Returns the number of rows (without a NULL value) of a columnIf a '*' is used instead of a column the number of selected rows is returned.

string

getCreateConstraintSQL(Constraint constraint, string|Table table)

Gets the SQL to create a constraint on a table on this platform.

void

getCreateDatabaseSQL(mixed database)

string

getCreateForeignKeySQL(ForeignKeyConstraint foreignKey, string|Table table)

Create a new foreign key

string

getCreateIndexSQL(Index index, string|Table table)

Gets the SQL to create an index on a table on this platform.

void

getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence sequence)

Gets the SQL to create a sequence on this platform.

array

getCreateTableSQL(string table, int createFlags)

Gets the SQL statement(s) to create a table with the specified name, columns and constraints on this platform.

void

getCreateTemporaryTableSnippetSQL()

void

getCreateViewSQL(mixed name, mixed sql)

string

getCurrentDateSQL()

Gets the SQL specific for the platform to get the current date.

string

getCurrentTimeSQL()

Gets the SQL specific for the platform to get the current time.

string

getCurrentTimestampSQL()

Gets the SQL specific for the platform to get the current timestamp

string

getCustomTypeDeclarationSQL(mixed columnDef)

getCustomTypeDeclarationSql Obtail SQL code portion needed to create a custom column, e.g.

string

getDateFormatString()

Gets the format string, as accepted by the date() function, that describes the format of a stored date value of this platform.

string

getDateTimeFormatString()

Gets the format string, as accepted by the date() function, that describes the format of a stored datetime value of this platform.

string

getDateTimeTypeDeclarationSQL(array fieldDeclaration)

Obtain DBMS specific SQL to be used to create datetime fields in statements like CREATE TABLE

string

getDateTypeDeclarationSQL(array fieldDeclaration)

Obtain DBMS specific SQL to be used to create date fields in statements like CREATE TABLE.

string

getDecimalTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a floating point column of arbitrary precision.

integer

getDefaultTransactionIsolationLevel()

Gets the default transaction isolation level of the platform.

string

getDefaultValueDeclarationSQL(array field)

Obtain DBMS specific SQL code portion needed to set a default value declaration to be used in statements like CREATE TABLE.

string

getDropConstraintSQL(\Doctrine\DBAL\Schema\Constraint constraint, string|Table table)

Get drop constraint sql

void

getDropDatabaseSQL(mixed database)

string

getDropForeignKeySQL(ForeignKeyConstraint|string foreignKey, Table|string table)

string

getDropIndexSQL(mixed index, string|Table table, Index|string name)

Drop index from a table

void

getDropSequenceSQL(mixed sequence)

string

getDropTableSQL(Table|string table)

Drop a Table

void

getDropViewSQL(mixed name)

string

getEmptyIdentityInsertSQL(string tableName, string identifierColumnName)

Get the insert sql for an empty insert statement

void

getForUpdateSql()

string

getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint foreignKey)

Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration to be used in statements like CREATE TABLE.

string

getForeignKeyDeclarationSQL(mixed foreignKey, array definition)

Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration to be used in statements like CREATE TABLE.

void

getForeignKeyReferentialActionSQL(string action, string foreign)

returns given referential action in uppercase if valid, otherwise throws an exception

string

getIdentifierQuoteCharacter()

Gets the character used for identifier quoting.

void

getIdentityColumnNullInsertSQL()

string

getInExpression(string column, string|array(string) values)

Returns the SQL to check if a value is one in a set of given values.

string

getIndexDeclarationSQL(string name, Index index)

Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.

string

getIndexFieldDeclarationListSQL(mixed fields)

getIndexFieldDeclarationList Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.

abstract string

getIntegerTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a 4 byte integer column.

string

getIsNotNullExpression(string expression)

Returns SQL that checks if a expression is not null.

string

getIsNullExpression(string expression)

Returns SQL that checks if a expression is null.

string

getLengthExpression(mixed column, string expression1, string expression2)

Returns the length of a text field.

void

getListDatabasesSQL()

void

getListSequencesSQL(mixed database)

void

getListTableColumnsSQL(mixed table)

void

getListTableConstraintsSQL(mixed table)

void

getListTableForeignKeysSQL(mixed table)

void

getListTableIndexesSQL(mixed table)

void

getListTablesSQL()

void

getListUsersSQL()

string

getListViewsSQL(string database)

Get the SQL to list all views of a database or user.

integer

getLocateExpression(string str, string substr, mixed startPos, int pos)

returns the position of the first occurrence of substring $substr in string $str

string

getLowerExpression(string str)

lower Returns the string $str with all characters changed to lowercase according to the current character set mapping.

string

getLtrimExpression(string str)

ltrim returns the string $str with leading space characters removed

string

getMaxExpression(string column)

Returns the highest value of a column

int

getMaxIdentifierLength()

Maximum length of any given databse identifier, like tables or column names.

string

getMd5Expression(mixed column)

Returns the md5 sum of a field.

string

getMinExpression(string column)

Returns the lowest value of a column

string

getModExpression(string expression1, string expression2)

Returns the remainder of the division operation $expression1 / $expression2.

abstract string

getName()

Gets the name of the platform.

string

getNotExpression(mixed expression)

Returns the SQL for a logical not.

string

getNowExpression()

Returns the current system date.

void

getPiExpression()

string

getRegexpExpression()

Returns the regular expression operator.

string

getRoundExpression(mixed column, mixed decimals, string expression1, string expression2)

Rounds a numeric field to the number of decimals specified.

string

getRtrimExpression(string str)

rtrim returns the string $str with proceeding space characters removed

string

getSQLResultCasing(string column)

Gets the character casing of a column in an SQL result set of this platform.

void

getSequenceNextValSQL(mixed sequenceName)

string

getSetCharsetSQL(string charset)

Gets the SQL statement specific for the platform to set the charset.

void

getSetTransactionIsolationSQL(integer level)

Get sql to set the transaction isolation level

string

getShowDatabasesSQL()

Get sql query to show a list of database.

void

getSinExpression(mixed value)

abstract string

getSmallIntTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a 2 byte integer column.

string

getSqlCommentEndString()

Gets the string portion that ends an SQL comment.

string

getSqlCommentStartString()

Gets the string portion that starts an SQL comment.

string

getSubstringExpression(string value, integer from, integer len)

return string to call a function to get a substring inside an SQL statementNote: Not SQL92, but common functionality.

string

getSumExpression(string column)

Returns the total sum of a column

string

getTemporaryTableSQL()

A method to return the required SQL string that fits between CREATE ...

string

getTimeFormatString()

Gets the format string, as accepted by the date() function, that describes the format of a stored time value of this platform.

string

getTimeTypeDeclarationSQL(array fieldDeclaration)

Obtain DBMS specific SQL to be used to create time fields in statements like CREATE TABLE.

string

getTrimExpression(string str, int pos, string char)

Trim a string, leading/trailing/both and with a given char which defaults to space.

string

getTruncateTableSQL(string tableName, bool cascade)

Generate a Truncate Table SQL statement for a given table.

string

getUniqueConstraintDeclarationSQL(string name, Index index)

Obtain DBMS specific SQL code portion needed to set a unique constraint declaration to be used in statements like CREATE TABLE.

string

getUniqueFieldDeclarationSQL()

Obtain DBMS specific SQL code portion needed to set the UNIQUE constraint of a field declaration to be used in statements like CREATE TABLE.

string

getUpperExpression(string str)

upper Returns the string $str with all characters changed to uppercase according to the current character set mapping.

integer

getVarcharMaxLength()

Gets the maximum length of a varchar field.

abstract void

getVarcharTypeDeclarationSQL(array field)

Gets the SQL snippet used to declare a VARCHAR column type.

array

getWildcards()

Gets all SQL wildcard characters of the platform.

void

modifyLimitQuery(mixed query, mixed limit, mixed offset)

boolean

prefersIdentityColumns()

Whether the platform prefers identity columns (eg.

boolean

prefersSequences()

Whether the platform prefers sequences for ID generation.

string

quoteIdentifier(string str)

Quotes a string so that it can be safely used as a table or column name, even if it is a reserved word of the platform.

void

supportsAlterTable()

boolean

supportsForeignKeyConstraints()

Does the platform supports foreign key constraints?

bool

supportsForeignKeyOnUpdate()

Does this platform supports onUpdate in foreign key constraints?

boolean

supportsGettingAffectedRows()

Whether the platform supports getting the affected rows of a recent update/delete type query.

boolean

supportsIdentityColumns()

Whether the platform supports identity columns.

boolean

supportsIndexes()

Whether the platform supports indexes.

boolean

supportsPrimaryConstraints()

Whether the platform supports primary key constraints.

boolean

supportsSavepoints()

Whether the platform supports savepoints.

boolean

supportsSchemas()

Whether the platform supports database schemas.

boolean

supportsSequences()

Whether the platform supports sequences.

boolean

supportsTransactions()

Whether the platform supports transactions.

Field Detail

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 57

CREATE_FOREIGNKEYS

public final int CREATE_FOREIGNKEYS = 2


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 52

CREATE_INDEXES

public final int CREATE_INDEXES = 1


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 77

TRIM_BOTH

public final int TRIM_BOTH = 3


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 67

TRIM_LEADING

public final int TRIM_LEADING = 1


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 72

TRIM_TRAILING

public final int TRIM_TRAILING = 2


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 62

TRIM_UNSPECIFIED

public final int $TRIM_UNSPECIFIED


Constructor Detail

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 82

AbstractPlatform

public AbstractPlatform()

Constructor.


Method Detail

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1382

convertBooleans

public void convertBooleans(mixed item)

Some platforms need the boolean values to be converted.

The default conversion in this implementation converts to integers (false => 0, true => 1).


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1696

createsExplicitIndexForForeignKeys

public bool createsExplicitIndexForForeignKeys()


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1805

fixSchemaElementName

public string fixSchemaElementName(mixed schemaElementName, string schemaName)

Makes any fixes to a name of a schema element (table, sequence, ...) that are required by restrictions of the platform, like a maximum length.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 471

getAcosExpression

public void getAcosExpression(mixed value)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1246

getAdvancedForeignKeyOptionsSQL

public string getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint foreignKey)

Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...

Parameters:
foreignKey - foreign key definition

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 829

getAlterTableSQL

public array getAlterTableSQL(TableDiff diff)

Gets the sql statements for altering an existing table.

The method returns an array of sql statements, since some platforms need several statements.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 150

getAvgExpression

public string getAvgExpression(string column)

Returns the average value of a column

Parameters:
column - the column to use
Returns:
generated sql including an AVG aggregate function

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 466

getBetweenExpression

public string getBetweenExpression(string expression, string value1, string value2)

Returns SQL that checks if an expression evaluates to a value between two values.

The parameter $expression is checked if it is between $value1 and $value2.

Note: There is a slight difference in the way BETWEEN works on some databases. http://www.w3schools.com/sql/sql_between.asp. If you want complete database independence you should avoid using between().

Parameters:
expression - the value to compare to
value1 - the lower value to compare with
value2 - the higher value to compare with
Returns:
logical expression

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1014

getBigIntTypeDeclarationSQL

public abstract string getBigIntTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares an 8 byte integer column.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 998

getBooleanTypeDeclarationSQL

public abstract string getBooleanTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a boolean column.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1063

getCheckDeclarationSQL

public string getCheckDeclarationSQL(array definition)

Obtain DBMS specific SQL code portion needed to set a CHECK constraint declaration to be used in statements like CREATE TABLE.

Parameters:
definition - check definition
Returns:
DBMS specific SQL code portion needed to set a CHECK constraint

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1778

getClobTypeDeclarationSQL

public abstract void getClobTypeDeclarationSQL(array field)

Gets the SQL snippet used to declare a CLOB column type.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1335

getColumnCharsetDeclarationSQL

public string getColumnCharsetDeclarationSQL(string charset)

Obtain DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration to be used in statements like CREATE TABLE.

Parameters:
charset - name of the charset
Returns:
DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1348

getColumnCollationDeclarationSQL

public string getColumnCollationDeclarationSQL(string collation)

Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.

Parameters:
collation - name of the collation
Returns:
DBMS specific SQL code portion needed to set the COLLATION of a field declaration.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 905

getColumnDeclarationListSQL

public string getColumnDeclarationListSQL(array fields)

Get declaration of a number of fields in bulk

Parameters:
fields - a multidimensional associative array. The first dimension determines the field name, while the second dimension is keyed with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows: length Integer value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS. default Text value to be used as default for this field. notnull Boolean flag that indicates whether this field is constrained to not be set to null. charset Text value with the default CHARACTER SET for this field. collation Text value with the default COLLATION for this field. unique unique constraint

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 948

getColumnDeclarationSQL

public string getColumnDeclarationSQL(string name, array field)

Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE.

Parameters:
name - name the field to be declared.
field - associative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows: length Integer value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS. default Text value to be used as default for this field. notnull Boolean flag that indicates whether this field is constrained to not be set to null. charset Text value with the default CHARACTER SET for this field. collation Text value with the default COLLATION for this field. unique unique constraint check column check constraint columnDefinition a string that defines the complete column
Returns:
DBMS specific SQL code portion that should be used to declare the column.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 380

getConcatExpression

public string getConcatExpression(string arg1,)

Returns a series of strings concatinated

concat() accepts an arbitrary number of parameters. Each parameter must contain an expression

Parameters:
arg1, - $arg2 ... $argN strings that will be concatinated.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 486

getCosExpression

public void getCosExpression(mixed value)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 164

getCountExpression

public string getCountExpression(string|integer column)

Returns the number of rows (without a NULL value) of a column

If a '*' is used instead of a column the number of selected rows is returned.

Parameters:
column - the column to use
Returns:
generated sql including a COUNT aggregate function

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 714

getCreateConstraintSQL

public string getCreateConstraintSQL(Constraint constraint, string|Table table)

Gets the SQL to create a constraint on a table on this platform.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1532

getCreateDatabaseSQL

public void getCreateDatabaseSQL(mixed database)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 810

getCreateForeignKeySQL

public string getCreateForeignKeySQL(ForeignKeyConstraint foreignKey, string|Table table)

Create a new foreign key

Parameters:
foreignKey - ForeignKey instance
table - name of the table on which the foreign key is to be created

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 761

getCreateIndexSQL

public string getCreateIndexSQL(Index index, string|Table table)

Gets the SQL to create an index on a table on this platform.

Parameters:
table - name of the table on which the index is to be created

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 702

getCreateSequenceSQL

public void getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence sequence)

Gets the SQL to create a sequence on this platform.

Throws:
DBALException

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 580

getCreateTableSQL

public array getCreateTableSQL(string table, int createFlags)

Gets the SQL statement(s) to create a table with the specified name, columns and constraints on this platform.

Parameters:
table - The name of the table.
Returns:
The sequence of SQL statements.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 691

getCreateTemporaryTableSnippetSQL

public void getCreateTemporaryTableSnippetSQL()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1512

getCreateViewSQL

public void getCreateViewSQL(mixed name, mixed sql)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1415

getCurrentDateSQL

public string getCurrentDateSQL()

Gets the SQL specific for the platform to get the current date.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1425

getCurrentTimeSQL

public string getCurrentTimeSQL()

Gets the SQL specific for the platform to get the current time.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1435

getCurrentTimestampSQL

public string getCurrentTimestampSQL()

Gets the SQL specific for the platform to get the current timestamp


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1136

getCustomTypeDeclarationSQL

public string getCustomTypeDeclarationSQL(mixed columnDef)

getCustomTypeDeclarationSql Obtail SQL code portion needed to create a custom column, e.g. when a field has the "columnDefinition" keyword. Only "AUTOINCREMENT" and "PRIMARY KEY" are added if appropriate.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1737

getDateFormatString

public string getDateFormatString()

Gets the format string, as accepted by the date() function, that describes the format of a stored date value of this platform.

Returns:
The format string.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1726

getDateTimeFormatString

public string getDateTimeFormatString()

Gets the format string, as accepted by the date() function, that describes the format of a stored datetime value of this platform.

Returns:
The format string.
Todo:
We need to get the specific format for each dbms and override this function for each platform

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1554

getDateTimeTypeDeclarationSQL

public string getDateTimeTypeDeclarationSQL(array fieldDeclaration)

Obtain DBMS specific SQL to be used to create datetime fields in statements like CREATE TABLE


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1566

getDateTypeDeclarationSQL

public string getDateTypeDeclarationSQL(array fieldDeclaration)

Obtain DBMS specific SQL to be used to create date fields in statements like CREATE TABLE.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 982

getDecimalTypeDeclarationSQL

public string getDecimalTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a floating point column of arbitrary precision.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1589

getDefaultTransactionIsolationLevel

public integer getDefaultTransactionIsolationLevel()

Gets the default transaction isolation level of the platform.

Returns:
The default isolation level.
See Also:
constants.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1039

getDefaultValueDeclarationSQL

public string getDefaultValueDeclarationSQL(array field)

Obtain DBMS specific SQL code portion needed to set a default value declaration to be used in statements like CREATE TABLE.

Parameters:
field - field definition array
Returns:
DBMS specific SQL code portion needed to set a default value

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 541

getDropConstraintSQL

public string getDropConstraintSQL(\Doctrine\DBAL\Schema\Constraint constraint, string|Table table)

Get drop constraint sql


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 496

getDropDatabaseSQL

public void getDropDatabaseSQL(mixed database)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 559

getDropForeignKeySQL

public string getDropForeignKeySQL(ForeignKeyConstraint|string foreignKey, Table|string table)


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 523

getDropIndexSQL

public string getDropIndexSQL(mixed index, string|Table table, Index|string name)

Drop index from a table


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1522

getDropSequenceSQL

public void getDropSequenceSQL(mixed sequence)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 507

getDropTableSQL

public string getDropTableSQL(Table|string table)

Drop a Table


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1517

getDropViewSQL

public void getDropViewSQL(mixed name)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1827

getEmptyIdentityInsertSQL

public string getEmptyIdentityInsertSQL(string tableName, string identifierColumnName)

Get the insert sql for an empty insert statement

Returns:
$sql

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 491

getForUpdateSql

public void getForUpdateSql()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1289

getForeignKeyBaseDeclarationSQL

public string getForeignKeyBaseDeclarationSQL(ForeignKeyConstraint foreignKey)

Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration to be used in statements like CREATE TABLE.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1231

getForeignKeyDeclarationSQL

public string getForeignKeyDeclarationSQL(mixed foreignKey, array definition)

Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration to be used in statements like CREATE TABLE.

Parameters:
definition - an associative array with the following structure: name optional constraint name local the local field(s) foreign the foreign reference field(s) foreignTable the name of the foreign table onDelete referential delete action onUpdate referential update action deferred deferred constraint checking The onDelete and onUpdate keys accept the following values: CASCADE: Delete or update the row from the parent table and automatically delete or update the matching rows in the child table. Both ON DELETE CASCADE and ON UPDATE CASCADE are supported. Between two tables, you should not define several ON UPDATE CASCADE clauses that act on the same column in the parent table or in the child table. SET NULL: Delete or update the row from the parent table and set the foreign key column or columns in the child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported. NO ACTION: In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary key value is not allowed to proceed if there is a related foreign key value in the referenced table. RESTRICT: Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as omitting the ON DELETE or ON UPDATE clause. SET DEFAULT
Returns:
DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1266

getForeignKeyReferentialActionSQL

public void getForeignKeyReferentialActionSQL(string action, string foreign)

returns given referential action in uppercase if valid, otherwise throws an exception

Throws:
if unknown referential action given
Parameters:
action - foreign key referential action
foreign - key referential action in uppercase

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 89

getIdentifierQuoteCharacter

public string getIdentifierQuoteCharacter()

Gets the character used for identifier quoting.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1712

getIdentityColumnNullInsertSQL

public void getIdentityColumnNullInsertSQL()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 416

getInExpression

public string getInExpression(string column, string|array(string) values)

Returns the SQL to check if a value is one in a set of given values.

in() accepts an arbitrary number of parameters. The first parameter must always specify the value that should be matched against. Successive must contain a logical expression or an array with logical expressions. These expressions will be matched against the first parameter.

Parameters:
column - the value that should be matched against
values - that will be matched against $column
Returns:
logical expression

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1111

getIndexDeclarationSQL

public string getIndexDeclarationSQL(string name, Index index)

Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.

Parameters:
name - name of the index
index - index definition
Returns:
DBMS specific SQL code portion needed to set an index

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1148

getIndexFieldDeclarationListSQL

public string getIndexFieldDeclarationListSQL(mixed fields)

getIndexFieldDeclarationList Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1006

getIntegerTypeDeclarationSQL

public abstract string getIntegerTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a 4 byte integer column.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 446

getIsNotNullExpression

public string getIsNotNullExpression(string expression)

Returns SQL that checks if a expression is not null.

Parameters:
expression - the expression that should be compared to null
Returns:
logical expression

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 435

getIsNullExpression

public string getIsNullExpression(string expression)

Returns SQL that checks if a expression is null.

Parameters:
expression - the expression that should be compared to null
Returns:
logical expression

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 223

getLengthExpression

public string getLengthExpression(mixed column, string expression1, string expression2)

Returns the length of a text field.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1461

getListDatabasesSQL

public void getListDatabasesSQL()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1466

getListSequencesSQL

public void getListSequencesSQL(mixed database)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1476

getListTableColumnsSQL

public void getListTableColumnsSQL(mixed table)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1471

getListTableConstraintsSQL

public void getListTableConstraintsSQL(mixed table)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1507

getListTableForeignKeysSQL

public void getListTableForeignKeysSQL(mixed table)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1502

getListTableIndexesSQL

public void getListTableIndexesSQL(mixed table)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1481

getListTablesSQL

public void getListTablesSQL()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1486

getListUsersSQL

public void getListUsersSQL()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1497

getListViewsSQL

public string getListViewsSQL(string database)

Get the SQL to list all views of a database or user.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 335

getLocateExpression

public integer getLocateExpression(string str, string substr, mixed startPos, int pos)

returns the position of the first occurrence of substring $substr in string $str

Parameters:
substr - literal string to find
str - literal string
pos - position to start at, beginning of string by default

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 322

getLowerExpression

public string getLowerExpression(string str)

lower Returns the string $str with all characters changed to lowercase according to the current character set mapping.

Parameters:
str - literal string or column name

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 296

getLtrimExpression

public string getLtrimExpression(string str)

ltrim returns the string $str with leading space characters removed

Parameters:
str - literal string or column name

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 175

getMaxExpression

public string getMaxExpression(string column)

Returns the highest value of a column

Parameters:
column - the column to use
Returns:
generated sql including a MAX aggregate function

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1815

getMaxIdentifierLength

public int getMaxIdentifierLength()

Maximum length of any given databse identifier, like tables or column names.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 211

getMd5Expression

public string getMd5Expression(mixed column)

Returns the md5 sum of a field.

Note: Not SQL92, but common functionality


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 186

getMinExpression

public string getMinExpression(string column)

Returns the lowest value of a column

Parameters:
column - the column to use

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 248

getModExpression

public string getModExpression(string expression1, string expression2)

Returns the remainder of the division operation $expression1 / $expression2.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1785

getName

public abstract string getName()

Gets the name of the platform.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 398

getNotExpression

public string getNotExpression(mixed expression)

Returns the SQL for a logical not.

Example: $q = new Doctrine_Query(); $e = $q->expr; $q->select('*')->from('table') ->where($e->eq('id', $e->not('null'));

Returns:
a logical expression

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 345

getNowExpression

public string getNowExpression()

Returns the current system date.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 481

getPiExpression

public void getPiExpression()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 139

getRegexpExpression

public string getRegexpExpression()

Returns the regular expression operator.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 235

getRoundExpression

public string getRoundExpression(mixed column, mixed decimals, string expression1, string expression2)

Rounds a numeric field to the number of decimals specified.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 284

getRtrimExpression

public string getRtrimExpression(string str)

rtrim returns the string $str with proceeding space characters removed

Parameters:
str - literal string or column name

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1793

getSQLResultCasing

public string getSQLResultCasing(string column)

Gets the character casing of a column in an SQL result set of this platform.

Parameters:
column - The column name for which to get the correct character casing.
Returns:
The column name in the character casing used in SQL result sets.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1527

getSequenceNextValSQL

public void getSequenceNextValSQL(mixed sequenceName)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1405

getSetCharsetSQL

public string getSetCharsetSQL(string charset)

Gets the SQL statement specific for the platform to set the charset.

This function is MySQL specific and required by \Doctrine\DBAL\Connection::setCharset($charset)


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1542

getSetTransactionIsolationSQL

public void getSetTransactionIsolationSQL(integer level)

Get sql to set the transaction isolation level


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1185

getShowDatabasesSQL

public string getShowDatabasesSQL()

Get sql query to show a list of database.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 476

getSinExpression

public void getSinExpression(mixed value)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1022

getSmallIntTypeDeclarationSQL

public abstract string getSmallIntTypeDeclarationSQL(array columnDef)

Gets the SQL snippet that declares a 2 byte integer column.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 109

getSqlCommentEndString

public string getSqlCommentEndString()

Gets the string portion that ends an SQL comment.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 99

getSqlCommentStartString

public string getSqlCommentStartString()

Gets the string portion that starts an SQL comment.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 362

getSubstringExpression

public string getSubstringExpression(string value, integer from, integer len)

return string to call a function to get a substring inside an SQL statement

Note: Not SQL92, but common functionality.

SQLite only supports the 2 parameter variant of this function

Parameters:
value - an sql string literal or column name/alias
from - where to start the substring portion
len - the substring portion length

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 197

getSumExpression

public string getSumExpression(string column)

Returns the total sum of a column

Parameters:
column - the column to use

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1175

getTemporaryTableSQL

public string getTemporaryTableSQL()

A method to return the required SQL string that fits between CREATE ... TABLE to create the table as a temporary table.

Should be overridden in driver classes to return the correct string for the specific database type.

The default is to return the string "TEMPORARY" - this will result in a SQL error for any database that does not support temporary tables, or that requires a different SQL command from "CREATE TEMPORARY TABLE".

Returns:
The string required to be placed between "CREATE" and "TABLE" to generate a temporary table, if possible.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1748

getTimeFormatString

public string getTimeFormatString()

Gets the format string, as accepted by the date() function, that describes the format of a stored time value of this platform.

Returns:
The format string.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1578

getTimeTypeDeclarationSQL

public string getTimeTypeDeclarationSQL(array fieldDeclaration)

Obtain DBMS specific SQL to be used to create time fields in statements like CREATE TABLE.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 261

getTrimExpression

public string getTrimExpression(string str, int pos, string char)

Trim a string, leading/trailing/both and with a given char which defaults to space.

Parameters:
char - has to be quoted already

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1842

getTruncateTableSQL

public string getTruncateTableSQL(string tableName, bool cascade)

Generate a Truncate Table SQL statement for a given table.

Cascade is not supported on many platforms but would optionally cascade the truncate by following the foreign keys.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1092

getUniqueConstraintDeclarationSQL

public string getUniqueConstraintDeclarationSQL(string name, Index index)

Obtain DBMS specific SQL code portion needed to set a unique constraint declaration to be used in statements like CREATE TABLE.

Parameters:
name - name of the unique constraint
index - index definition
Returns:
DBMS specific SQL code portion needed to set a constraint

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1322

getUniqueFieldDeclarationSQL

public string getUniqueFieldDeclarationSQL()

Obtain DBMS specific SQL code portion needed to set the UNIQUE constraint of a field declaration to be used in statements like CREATE TABLE.

Returns:
DBMS specific SQL code portion needed to set the UNIQUE constraint of a field declaration.

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 309

getUpperExpression

public string getUpperExpression(string str)

upper Returns the string $str with all characters changed to uppercase according to the current character set mapping.

Parameters:
str - literal string or column name

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 119

getVarcharMaxLength

public integer getVarcharMaxLength()

Gets the maximum length of a varchar field.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1771

getVarcharTypeDeclarationSQL

public abstract void getVarcharTypeDeclarationSQL(array field)

Gets the SQL snippet used to declare a VARCHAR column type.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 129

getWildcards

public array getWildcards()

Gets all SQL wildcard characters of the platform.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1753

modifyLimitQuery

public void modifyLimitQuery(mixed query, mixed limit, mixed offset)

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1370

prefersIdentityColumns

public boolean prefersIdentityColumns()

Whether the platform prefers identity columns (eg. autoincrement) for ID generation. Subclasses should override this method to return TRUE if they prefer identity columns.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1359

prefersSequences

public boolean prefersSequences()

Whether the platform prefers sequences for ID generation. Subclasses should override this method to return TRUE if they prefer sequences.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 796

quoteIdentifier

public string quoteIdentifier(string str)

Quotes a string so that it can be safely used as a table or column name, even if it is a reserved word of the platform.

NOTE: Just because you CAN use quoted identifiers doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve.

Parameters:
str - identifier name to be quoted
Returns:
quoted identifier string

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1628

supportsAlterTable

public void supportsAlterTable()

/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1668

supportsForeignKeyConstraints

public boolean supportsForeignKeyConstraints()

Does the platform supports foreign key constraints?


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1678

supportsForeignKeyOnUpdate

public bool supportsForeignKeyOnUpdate()

Does this platform supports onUpdate in foreign key constraints?


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1707

supportsGettingAffectedRows

public boolean supportsGettingAffectedRows()

Whether the platform supports getting the affected rows of a recent update/delete type query.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1613

supportsIdentityColumns

public boolean supportsIdentityColumns()

Whether the platform supports identity columns. Identity columns are columns that recieve an auto-generated value from the database on insert of a row.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1623

supportsIndexes

public boolean supportsIndexes()

Whether the platform supports indexes.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1658

supportsPrimaryConstraints

public boolean supportsPrimaryConstraints()

Whether the platform supports primary key constraints.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1648

supportsSavepoints

public boolean supportsSavepoints()

Whether the platform supports savepoints.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1688

supportsSchemas

public boolean supportsSchemas()

Whether the platform supports database schemas.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1601

supportsSequences

public boolean supportsSequences()

Whether the platform supports sequences.


/Doctrine/DBAL/Platforms/AbstractPlatform.php at line 1638

supportsTransactions

public boolean supportsTransactions()

Whether the platform supports transactions.


Doctrine