class DefaultPlatform implements PlatformInterface
Default implementation for the PlatformInterface interface.
Methods
__construct(ConnectionInterface $con = null)
Default constructor. |
||
getObjectBuilderClass($type) | ||
setConnection(ConnectionInterface $con = null)
Sets the database connection to use for this Platform class. |
||
ConnectionInterface |
getConnection()
Returns the database connection to use for this Platform class. |
|
string|null |
getBuilderClass($type $type)
Returns a platform specific builder class if exists. |
|
setGeneratorConfig(GeneratorConfigInterface $config)
Sets the GeneratorConfigInterface to use in the parsing. |
||
string |
getDatabaseType()
Returns the short name of the database type that this platform represents. |
|
int |
getMaxColumnNameLength()
Returns the max column length supported by the db. |
|
string |
getNativeIdMethod()
Returns the native IdMethod (sequence|identity) |
|
isNativeIdMethodAutoIncrement() | ||
Domain |
getDomainForType(string $mappingType)
Returns the database specific domain for a mapping type. |
|
string. |
getNullString($notNull)
Returns the NOT NULL string for the configured RDBMS. |
|
string. |
getAutoIncrement()
Returns the auto increment strategy for the configured RDBMS. |
|
string |
getSequenceName(Table $table)
Returns the name to use for creating a table sequence. |
|
string |
getAddTablesDDL(Database $database)
Returns the DDL SQL to add the tables of a database together with index and foreign keys |
|
string |
getBeginDDL()
Gets the requests to execute at the beginning of a DDL file |
|
string |
getEndDDL()
Gets the requests to execute at the end of a DDL file |
|
string |
getDropTableDDL(Table $table)
Builds the DDL SQL to drop a table |
|
string |
getAddTableDDL(Table $table)
Builds the DDL SQL to add a table without index and foreign keys |
|
string |
getColumnDDL(Column $col)
Builds the DDL SQL for a Column object. |
|
string |
getColumnDefaultValueDDL(Column $col)
Returns the SQL for the default value of a Column object |
|
string |
getColumnListDDL(Column[]|string[] $columns, string $delimiter = ',')
Creates a delimiter-delimited string list of column names, quoted using quoteIdentifier(). |
|
string |
getPrimaryKeyName(Table $table)
Returns the name of a table primary key. |
|
string |
getPrimaryKeyDDL(Table $table)
Returns the SQL for the primary key of a Table object. |
|
string |
getDropPrimaryKeyDDL(Table $table)
Returns the DDL SQL to drop the primary key of a table. |
|
string |
getAddPrimaryKeyDDL(Table $table)
Returns the DDL SQL to add the primary key of a table. |
|
string |
getAddIndicesDDL(Table $table)
Returns the DDL SQL to add the indices of a table. |
|
string |
getAddIndexDDL(Index $index)
Returns the DDL SQL to add an Index. |
|
string |
getDropIndexDDL(Index $index)
Builds the DDL SQL to drop an Index. |
|
string |
getIndexDDL(Index $index)
Builds the DDL SQL for an Index object. |
|
string |
getUniqueDDL(Unique $unique)
Builds the DDL SQL for a Unique constraint object. |
|
string |
getAddForeignKeysDDL(Table $table)
Builds the DDL SQL to add the foreign keys of a table. |
|
string |
getAddForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL to add a foreign key. |
|
string |
getDropForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL to drop a foreign key. |
|
string |
getForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL for a ForeignKey object. |
|
getCommentLineDDL($comment) | ||
getCommentBlockDDL($comment) | ||
string |
getModifyDatabaseDDL(DatabaseDiff $databaseDiff)
Builds the DDL SQL to modify a database based on a DatabaseDiff instance |
|
string |
getRenameTableDDL($fromTableName, $toTableName)
Builds the DDL SQL to rename a table |
|
string |
getModifyTableDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a TableDiff instance |
|
string |
getModifyTableColumnsDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a TableDiff instance |
|
string |
getModifyTablePrimaryKeyDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table's primary key based on a TableDiff instance |
|
string |
getModifyTableIndicesDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table's indices based on a TableDiff instance |
|
string |
getModifyTableForeignKeysDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table's foreign keys based on a TableDiff instance |
|
string |
getRemoveColumnDDL(Column $column)
Builds the DDL SQL to remove a column |
|
string |
getRenameColumnDDL($fromColumn, $toColumn)
Builds the DDL SQL to rename a column |
|
string |
getModifyColumnDDL(ColumnDiff $columnDiff)
Builds the DDL SQL to modify a column |
|
string |
getModifyColumnsDDL($columnDiffs)
Builds the DDL SQL to modify a list of columns |
|
string |
getAddColumnDDL(Column $column)
Builds the DDL SQL to remove a column |
|
string |
getAddColumnsDDL($columns)
Builds the DDL SQL to remove a list of columns |
|
boolean |
hasSize(string $sqlType)
Returns if the RDBMS-specific SQL type has a size attribute. |
|
boolean |
hasScale(string $sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute. |
|
string |
quote(string $text)
Quote and escape needed characters in the string for underlying RDBMS. |
|
string |
quoteIdentifier(string $text)
Quotes identifiers used in database SQL. |
|
setIdentifierQuoting($enabled = true) | ||
getIdentifierQuoting() | ||
boolean |
supportsNativeDeleteTrigger()
Whether RDBMS supports native ON DELETE triggers (e.g. |
|
boolean |
supportsInsertNullPk()
Whether RDBMS supports INSERT null values in autoincremented primary keys |
|
boolean |
hasStreamBlobImpl()
Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings). |
|
boolean | supportsSchemas() | |
boolean | supportsMigrations() | |
boolean |
supportsVarcharWithoutSize()
Whether RDBMS supports VARCHAR without explicit size |
|
mixed |
getBooleanString($b)
Returns the Boolean value for the RDBMS. |
|
getPhpArrayString($stringValue) | ||
string |
getTimestampFormatter()
Gets the preferred timestamp formatter for setting date/time values. |
|
string |
getTimeFormatter()
Gets the preferred time formatter for setting date/time values. |
|
string |
getDateFormatter()
Gets the preferred date formatter for setting date/time values. |
|
getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = ' ')
Get the PHP snippet for binding a value to a column. |
||
getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = ' ')
Get the PHP snippet for getting a Pk from the database. |
Details
at line 59
public
__construct(ConnectionInterface $con = null)
Default constructor.
at line 68
public
getObjectBuilderClass($type)
at line 78
public
setConnection(ConnectionInterface $con = null)
Sets the database connection to use for this Platform class.
at line 88
public ConnectionInterface
getConnection()
Returns the database connection to use for this Platform class.
at line 100
public string|null
getBuilderClass($type $type)
Returns a platform specific builder class if exists.
at line 116
public
setGeneratorConfig(GeneratorConfigInterface $config)
Sets the GeneratorConfigInterface to use in the parsing.
at line 167
public string
getDatabaseType()
Returns the short name of the database type that this platform represents.
For example MysqlPlatform->getDatabaseType() returns 'mysql'.
at line 181
public int
getMaxColumnNameLength()
Returns the max column length supported by the db.
at line 191
public string
getNativeIdMethod()
Returns the native IdMethod (sequence|identity)
at line 196
public
isNativeIdMethodAutoIncrement()
at line 207
public Domain
getDomainForType(string $mappingType)
Returns the database specific domain for a mapping type.
at line 221
public string.
getNullString($notNull)
Returns the NOT NULL string for the configured RDBMS.
at line 231
public string.
getAutoIncrement()
Returns the auto increment strategy for the configured RDBMS.
at line 246
public string
getSequenceName(Table $table)
Returns the name to use for creating a table sequence.
This will create a new name or use one specified in an
id-method-parameter tag, if specified.
at line 276
public string
getAddTablesDDL(Database $database)
Returns the DDL SQL to add the tables of a database together with index and foreign keys
at line 296
public string
getBeginDDL()
Gets the requests to execute at the beginning of a DDL file
at line 305
public string
getEndDDL()
Gets the requests to execute at the end of a DDL file
at line 313
public string
getDropTableDDL(Table $table)
Builds the DDL SQL to drop a table
at line 326
public string
getAddTableDDL(Table $table)
Builds the DDL SQL to add a table without index and foreign keys
at line 365
public string
getColumnDDL(Column $col)
Builds the DDL SQL for a Column object.
at line 393
public string
getColumnDefaultValueDDL(Column $col)
Returns the SQL for the default value of a Column object
at line 436
public string
getColumnListDDL(Column[]|string[] $columns, string $delimiter = ',')
Creates a delimiter-delimited string list of column names, quoted using quoteIdentifier().
at line 454
public string
getPrimaryKeyName(Table $table)
Returns the name of a table primary key.
at line 466
public string
getPrimaryKeyDDL(Table $table)
Returns the SQL for the primary key of a Table object.
at line 479
public string
getDropPrimaryKeyDDL(Table $table)
Returns the DDL SQL to drop the primary key of a table.
at line 497
public string
getAddPrimaryKeyDDL(Table $table)
Returns the DDL SQL to add the primary key of a table.
at line 515
public string
getAddIndicesDDL(Table $table)
Returns the DDL SQL to add the indices of a table.
at line 531
public string
getAddIndexDDL(Index $index)
Returns the DDL SQL to add an Index.
at line 551
public string
getDropIndexDDL(Index $index)
Builds the DDL SQL to drop an Index.
at line 568
public string
getIndexDDL(Index $index)
Builds the DDL SQL for an Index object.
at line 583
public string
getUniqueDDL(Unique $unique)
Builds the DDL SQL for a Unique constraint object.
at line 594
public string
getAddForeignKeysDDL(Table $table)
Builds the DDL SQL to add the foreign keys of a table.
at line 610
public string
getAddForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL to add a foreign key.
at line 631
public string
getDropForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL to drop a foreign key.
at line 650
public string
getForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL for a ForeignKey object.
at line 676
public
getCommentLineDDL($comment)
at line 684
public
getCommentBlockDDL($comment)
at line 701
public string
getModifyDatabaseDDL(DatabaseDiff $databaseDiff)
Builds the DDL SQL to modify a database based on a DatabaseDiff instance
at line 735
public string
getRenameTableDDL($fromTableName, $toTableName)
Builds the DDL SQL to rename a table
at line 753
public string
getModifyTableDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a TableDiff instance
at line 818
public string
getModifyTableColumnsDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a TableDiff instance
at line 847
public string
getModifyTablePrimaryKeyDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table's primary key based on a TableDiff instance
at line 865
public string
getModifyTableIndicesDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table's indices based on a TableDiff instance
at line 892
public string
getModifyTableForeignKeysDDL(TableDiff $tableDiff)
Builds the DDL SQL to alter a table's foreign keys based on a TableDiff instance
at line 918
public string
getRemoveColumnDDL(Column $column)
Builds the DDL SQL to remove a column
at line 935
public string
getRenameColumnDDL($fromColumn, $toColumn)
Builds the DDL SQL to rename a column
at line 953
public string
getModifyColumnDDL(ColumnDiff $columnDiff)
Builds the DDL SQL to modify a column
at line 971
public string
getModifyColumnsDDL($columnDiffs)
Builds the DDL SQL to modify a list of columns
at line 1004
public string
getAddColumnDDL(Column $column)
Builds the DDL SQL to remove a column
at line 1021
public string
getAddColumnsDDL($columns)
Builds the DDL SQL to remove a list of columns
at line 1054
public boolean
hasSize(string $sqlType)
Returns if the RDBMS-specific SQL type has a size attribute.
at line 1065
public boolean
hasScale(string $sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute.
at line 1075
public string
quote(string $text)
Quote and escape needed characters in the string for underlying RDBMS.
at line 1103
public string
quoteIdentifier(string $text)
Quotes identifiers used in database SQL.
at line 1108
public
setIdentifierQuoting($enabled = true)
at line 1113
public
getIdentifierQuoting()
at line 1122
public boolean
supportsNativeDeleteTrigger()
Whether RDBMS supports native ON DELETE triggers (e.g.
ON DELETE CASCADE).
at line 1131
public boolean
supportsInsertNullPk()
Whether RDBMS supports INSERT null values in autoincremented primary keys
at line 1141
public boolean
hasStreamBlobImpl()
Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings).
at line 1149
public boolean
supportsSchemas()
at line 1157
public boolean
supportsMigrations()
at line 1163
public boolean
supportsVarcharWithoutSize()
Whether RDBMS supports VARCHAR without explicit size
at line 1179
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.
at line 1197
public
getPhpArrayString($stringValue)
at line 1221
public string
getTimestampFormatter()
Gets the preferred timestamp formatter for setting date/time values.
at line 1230
public string
getTimeFormatter()
Gets the preferred time formatter for setting date/time values.
at line 1239
public string
getDateFormatter()
Gets the preferred date formatter for setting date/time values.
at line 1249
public
getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = ' ')
Get the PHP snippet for binding a value to a column.
Warning: duplicates logic from AdapterInterface::bindValue().
Any code modification here must be ported there.
at line 1284
public
getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = ' ')
Get the PHP snippet for getting a Pk from the database.
Warning: duplicates logic from AdapterInterface::getId().
Any code modification here must be ported there.
Typical output:
<code>
$this->id = $con->lastInsertId();
</code>