Propel API
Class

MssqlPlatform

class MssqlPlatform extends DefaultPlatform

MS SQL PropelPlatformInterface implementation.

Methods

__construct(PDO $con = null)

Default constructor.

from DefaultPlatform
setConnection(PDO $con = null)

Set the database connection to use for this Platform class.

from DefaultPlatform
PDO getConnection()

Returns the database connection to use for this Platform class.

from DefaultPlatform
setGeneratorConfig(GeneratorConfig $config)

Sets the GeneratorConfig to use in the parsing.

from DefaultPlatform
string getDatabaseType()

Returns the short name of the database type that this platform represents.

from DefaultPlatform
getMaxColumnNameLength()

string getNativeIdMethod()

Returns the native IdMethod (sequence|identity)

from DefaultPlatform
Domain getDomainForType(string $propelType)

Returns the db specific domain for a propelType.

from DefaultPlatform
getNullString($notNull)

The getAutoIncrement()

from DefaultPlatform
string getSequenceName(Table $table)

Gets the name to use for creating a sequence for a table.

from DefaultPlatform
string getAddTablesDDL(Database $database)

Builds the DDL SQL to add the tables of a database together with index and foreign keys

from DefaultPlatform
string getBeginDDL()

Gets the requests to execute at the beginning of a DDL file

from DefaultPlatform
string getEndDDL()

Gets the requests to execute at the end of a DDL file

from DefaultPlatform
getDropTableDDL(Table $table)

string getAddTableDDL(Table $table)

Builds the DDL SQL to add a table without index and foreign keys

from DefaultPlatform
string getColumnDDL(Column $col)

Builds the DDL SQL for a Column object.

from DefaultPlatform
string getColumnDefaultValueDDL(Column $col)

Returns the SQL for the default value of a Column object

from DefaultPlatform
string getColumnListDDL($columns, $delimiter = ',')

Creates a delimiter-delimited string list of column names, quoted using quoteIdentifier().

from DefaultPlatform
string getPrimaryKeyName(Table $table)

Returns the name of a table primary key

from DefaultPlatform
getPrimaryKeyDDL(Table $table)

string getDropPrimaryKeyDDL(Table $table)

Builds the DDL SQL to drop the primary key of a table.

from DefaultPlatform
string getAddPrimaryKeyDDL(Table $table)

Builds the DDL SQL to add the primary key of a table.

from DefaultPlatform
string getAddIndicesDDL(Table $table)

Builds the DDL SQL to add the indices of a table.

from DefaultPlatform
string getAddIndexDDL(Index $index)

Builds the DDL SQL to add an Index.

from DefaultPlatform
string getDropIndexDDL(Index $index)

Builds the DDL SQL to drop an Index.

from DefaultPlatform
string getIndexDDL(Index $index)

Builds the DDL SQL for an Index object.

from DefaultPlatform
string getUniqueDDL(Unique $unique)

Builds the DDL SQL for a Unique constraint object.

from DefaultPlatform
string getAddForeignKeysDDL(Table $table)

Builds the DDL SQL to add the foreign keys of a table.

from DefaultPlatform
getAddForeignKeyDDL(ForeignKey $fk)

string getDropForeignKeyDDL(ForeignKey $fk)

Builds the DDL SQL to drop a foreign key.

from DefaultPlatform
getForeignKeyDDL(ForeignKey $fk)

getCommentLineDDL($comment)

from DefaultPlatform
getCommentBlockDDL($comment)

from DefaultPlatform
string getModifyDatabaseDDL(PropelDatabaseDiff $databaseDiff)

Builds the DDL SQL to modify a database based on a PropelDatabaseDiff instance

from DefaultPlatform
string getRenameTableDDL($fromTableName, $toTableName)

Builds the DDL SQL to rename a table

from DefaultPlatform
string getModifyTableDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table based on a PropelTableDiff instance

from DefaultPlatform
string getModifyTableColumnsDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table based on a PropelTableDiff instance

from DefaultPlatform
string getModifyTablePrimaryKeyDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table's primary key based on a PropelTableDiff instance

from DefaultPlatform
string getModifyTableIndicesDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table's indices based on a PropelTableDiff instance

from DefaultPlatform
string getModifyTableForeignKeysDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table's foreign keys based on a PropelTableDiff instance

from DefaultPlatform
string getRemoveColumnDDL(Column $column)

Builds the DDL SQL to remove a column

from DefaultPlatform
string getRenameColumnDDL($fromColumn, $toColumn)

Builds the DDL SQL to rename a column

from DefaultPlatform
string getModifyColumnDDL(PropelColumnDiff $columnDiff)

Builds the DDL SQL to modify a column

from DefaultPlatform
string getModifyColumnsDDL($columnDiffs)

Builds the DDL SQL to modify a list of columns

from DefaultPlatform
string getAddColumnDDL(Column $column)

Builds the DDL SQL to remove a column

from DefaultPlatform
string getAddColumnsDDL($columns)

Builds the DDL SQL to remove a list of columns

from DefaultPlatform
hasSize($sqlType)

boolean hasScale(string $sqlType)

Returns if the RDBMS-specific SQL type has a scale attribute.

from DefaultPlatform
string quote(string $text)

Quote and escape needed characters in the string for unerlying RDBMS.

from DefaultPlatform
quoteIdentifier($text)

setIdentifierQuoting($enabled = true)

from DefaultPlatform
getIdentifierQuoting()

from DefaultPlatform
supportsNativeDeleteTrigger()

supportsInsertNullPk()

boolean hasStreamBlobImpl()

Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings).

from DefaultPlatform
supportsSchemas()

mixed getBooleanString($b)

Returns the boolean value for the RDBMS.

from DefaultPlatform
getTimestampFormatter()

string getTimeFormatter()

Gets the preferred time formatter for setting date/time values.

from DefaultPlatform
string getDateFormatter()

Gets the preferred date formatter for setting date/time values.

from DefaultPlatform

Details

in DefaultPlatform at line 48
public __construct(PDO $con = null)

Default constructor.

Parameters

PDO $con Optional database connection to use in this platform.

in DefaultPlatform at line 58
public setConnection(PDO $con = null)

Set the database connection to use for this Platform class.

Parameters

PDO $con Database connection to use in this platform.

in DefaultPlatform at line 67
public PDO getConnection()

Returns the database connection to use for this Platform class.

Return Value

PDO The database connection or NULL if none has been set.

in DefaultPlatform at line 77
public setGeneratorConfig(GeneratorConfig $config)

Sets the GeneratorConfig to use in the parsing.

Parameters

GeneratorConfig $config

in DefaultPlatform at line 127
public string getDatabaseType()

Returns the short name of the database type that this platform represents.

For example MysqlPlatform->getDatabaseType() returns 'mysql'.

Return Value

string

at line 51
public getMaxColumnNameLength()

in DefaultPlatform at line 149
public string getNativeIdMethod()

Returns the native IdMethod (sequence|identity)

Return Value

string The native IdMethod (PropelPlatformInterface:IDENTITY, PropelPlatformInterface::SEQUENCE).

in DefaultPlatform at line 160
public Domain getDomainForType(string $propelType)

Returns the db specific domain for a propelType.

Parameters

string $propelType the Propel type name.

Return Value

Domain The db specific domain.

at line 56
public getNullString($notNull)

Parameters

$notNull

in DefaultPlatform at line 180
public The getAutoIncrement()

Return Value

The RDBMS-specific SQL fragment for autoincrement.

in DefaultPlatform at line 195
public string getSequenceName(Table $table)

Gets the name to use for creating a sequence for a table.

This will create a new name or use one specified in an id-method-parameter
tag, if specified.

Parameters

Table $table

Return Value

string Sequence name for this table.

in DefaultPlatform at line 225
public string getAddTablesDDL(Database $database)

Builds the DDL SQL to add the tables of a database together with index and foreign keys

Parameters

Database $database

Return Value

string

in DefaultPlatform at line 244
public string getBeginDDL()

Gets the requests to execute at the beginning of a DDL file

Return Value

string

in DefaultPlatform at line 253
public string getEndDDL()

Gets the requests to execute at the end of a DDL file

Return Value

string

at line 71
public getDropTableDDL(Table $table)

Parameters

Table $table

in DefaultPlatform at line 274
public string getAddTableDDL(Table $table)

Builds the DDL SQL to add a table without index and foreign keys

Parameters

Table $table

Return Value

string

in DefaultPlatform at line 312
public string getColumnDDL(Column $col)

Builds the DDL SQL for a Column object.

Parameters

Column $col

Return Value

string

in DefaultPlatform at line 340
public string getColumnDefaultValueDDL(Column $col)

Returns the SQL for the default value of a Column object

Parameters

Column $col

Return Value

string

in DefaultPlatform at line 376
public string getColumnListDDL($columns, $delimiter = ',')

Creates a delimiter-delimited string list of column names, quoted using quoteIdentifier().

Parameters

$columns
$delimiter

Return Value

string

in DefaultPlatform at line 392
public string getPrimaryKeyName(Table $table)

Returns the name of a table primary key

Parameters

Table $table

Return Value

string

at line 112
public getPrimaryKeyDDL(Table $table)

Parameters

Table $table

in DefaultPlatform at line 415
public string getDropPrimaryKeyDDL(Table $table)

Builds the DDL SQL to drop the primary key of a table.

Parameters

Table $table

Return Value

string

in DefaultPlatform at line 432
public string getAddPrimaryKeyDDL(Table $table)

Builds the DDL SQL to add the primary key of a table.

Parameters

Table $table

Return Value

string

in DefaultPlatform at line 449
public string getAddIndicesDDL(Table $table)

Builds the DDL SQL to add the indices of a table.

Parameters

Table $table

Return Value

string

in DefaultPlatform at line 464
public string getAddIndexDDL(Index $index)

Builds the DDL SQL to add an Index.

Parameters

Index $index

Return Value

string

in DefaultPlatform at line 483
public string getDropIndexDDL(Index $index)

Builds the DDL SQL to drop an Index.

Parameters

Index $index

Return Value

string

in DefaultPlatform at line 499
public string getIndexDDL(Index $index)

Builds the DDL SQL for an Index object.

Parameters

Index $index

Return Value

string

in DefaultPlatform at line 514
public string getUniqueDDL(Unique $unique)

Builds the DDL SQL for a Unique constraint object.

Parameters

Unique $unique

Return Value

string

in DefaultPlatform at line 525
public string getAddForeignKeysDDL(Table $table)

Builds the DDL SQL to add the foreign keys of a table.

Parameters

Table $table

Return Value

string

at line 123
public getAddForeignKeyDDL(ForeignKey $fk)

Parameters

ForeignKey $fk

in DefaultPlatform at line 560
public string getDropForeignKeyDDL(ForeignKey $fk)

Builds the DDL SQL to drop a foreign key.

Parameters

ForeignKey $fk

Return Value

string

at line 140
public getForeignKeyDDL(ForeignKey $fk)

Parameters

ForeignKey $fk

in DefaultPlatform at line 604
public getCommentLineDDL($comment)

Parameters

$comment

in DefaultPlatform at line 611
public getCommentBlockDDL($comment)

Parameters

$comment

in DefaultPlatform at line 627
public string getModifyDatabaseDDL(PropelDatabaseDiff $databaseDiff)

Builds the DDL SQL to modify a database based on a PropelDatabaseDiff instance

Parameters

PropelDatabaseDiff $databaseDiff

Return Value

string

in DefaultPlatform at line 658
public string getRenameTableDDL($fromTableName, $toTableName)

Builds the DDL SQL to rename a table

Parameters

$fromTableName
$toTableName

Return Value

string

in DefaultPlatform at line 675
public string getModifyTableDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table based on a PropelTableDiff instance

Parameters

PropelTableDiff $tableDiff

Return Value

string

in DefaultPlatform at line 740
public string getModifyTableColumnsDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table based on a PropelTableDiff instance

Parameters

PropelTableDiff $tableDiff

Return Value

string

in DefaultPlatform at line 769
public string getModifyTablePrimaryKeyDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table's primary key based on a PropelTableDiff instance

Parameters

PropelTableDiff $tableDiff

Return Value

string

in DefaultPlatform at line 787
public string getModifyTableIndicesDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table's indices based on a PropelTableDiff instance

Parameters

PropelTableDiff $tableDiff

Return Value

string

in DefaultPlatform at line 814
public string getModifyTableForeignKeysDDL(PropelTableDiff $tableDiff)

Builds the DDL SQL to alter a table's foreign keys based on a PropelTableDiff instance

Parameters

PropelTableDiff $tableDiff

Return Value

string

in DefaultPlatform at line 840
public string getRemoveColumnDDL(Column $column)

Builds the DDL SQL to remove a column

Parameters

Column $column

Return Value

string

in DefaultPlatform at line 855
public string getRenameColumnDDL($fromColumn, $toColumn)

Builds the DDL SQL to rename a column

Parameters

$fromColumn
$toColumn

Return Value

string

in DefaultPlatform at line 872
public string getModifyColumnDDL(PropelColumnDiff $columnDiff)

Builds the DDL SQL to modify a column

Parameters

PropelColumnDiff $columnDiff

Return Value

string

in DefaultPlatform at line 889
public string getModifyColumnsDDL($columnDiffs)

Builds the DDL SQL to modify a list of columns

Parameters

$columnDiffs

Return Value

string

in DefaultPlatform at line 921
public string getAddColumnDDL(Column $column)

Builds the DDL SQL to remove a column

Parameters

Column $column

Return Value

string

in DefaultPlatform at line 937
public string getAddColumnsDDL($columns)

Builds the DDL SQL to remove a list of columns

Parameters

$columns

Return Value

string

at line 170
public hasSize($sqlType)

Parameters

$sqlType

in DefaultPlatform at line 980
public boolean hasScale(string $sqlType)

Returns if the RDBMS-specific SQL type has a scale attribute.

Parameters

string $sqlType the SQL type

Return Value

boolean True if the type has a scale attribute

in DefaultPlatform at line 990
public string quote(string $text)

Quote and escape needed characters in the string for unerlying RDBMS.

Parameters

string $text

Return Value

string

at line 175
public quoteIdentifier($text)

Parameters

$text

in DefaultPlatform at line 1023
public setIdentifierQuoting($enabled = true)

Parameters

$enabled

in DefaultPlatform at line 1028
public getIdentifierQuoting()

at line 61
public supportsNativeDeleteTrigger()

at line 66
public supportsInsertNullPk()

in DefaultPlatform at line 1055
public boolean hasStreamBlobImpl()

Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings).

Return Value

boolean

at line 165
public supportsSchemas()

See also

Platform::supportsSchemas()

in DefaultPlatform at line 1080
public mixed getBooleanString($b)

Returns the boolean value for the RDBMS.

This value should match the boolean value that is set
when using Propel's PreparedStatement::setBoolean().

This function is used to set default column values when building
SQL.

Parameters

$b

Return Value

mixed

at line 180
public getTimestampFormatter()

in DefaultPlatform at line 1099
public string getTimeFormatter()

Gets the preferred time formatter for setting date/time values.

Return Value

string

in DefaultPlatform at line 1108
public string getDateFormatter()

Gets the preferred date formatter for setting date/time values.

Return Value

string