class MysqlPlatform extends DefaultPlatform
MySql 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(GeneratorConfigInterface $generatorConfig)
Sets the GeneratorConfig to use in the parsing. |
||
string |
getDatabaseType()
Returns the short name of the database type that this platform represents. |
from DefaultPlatform |
int |
getMaxColumnNameLength()
Returns the max column length supported by the db. |
|
string |
getNativeIdMethod()
Returns the native IdMethod (sequence|identity) |
from DefaultPlatform |
isNativeIdMethodAutoIncrement()
|
from DefaultPlatform | |
Domain |
getDomainForType(string $propelType)
Returns the db specific domain for a propelType. |
from DefaultPlatform |
string |
getNullString($notNull)
|
from DefaultPlatform |
The |
getAutoIncrement()
|
|
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 |
|
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 |
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 |
string |
getPrimaryKeyDDL(Table $table)
Returns the SQL for the primary key of a Table object |
|
string |
getDropPrimaryKeyDDL(Table $table)
Builds the DDL SQL to drop the primary key of a table. |
|
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. |
|
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. |
from DefaultPlatform |
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)
|
from DefaultPlatform | |
getCommentBlockDDL($comment)
|
||
string |
getModifyDatabaseDDL(PropelDatabaseDiff $databaseDiff)
Builds the DDL SQL to modify a database based on a PropelDatabaseDiff instance |
|
string |
getRenameTableDDL($fromTableName, $toTableName)
Builds the DDL SQL to rename a table |
|
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 |
|
string |
getRenameColumnDDL($fromColumn, $toColumn)
Builds the DDL SQL to rename a column |
|
string |
getModifyColumnDDL(PropelColumnDiff $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 |
from DefaultPlatform |
string |
getAddColumnsDDL($columns)
Builds the DDL SQL to add 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. |
from DefaultPlatform |
string |
quote(string $text)
Quote and escape needed characters in the string for underlying RDBMS. |
from DefaultPlatform |
string |
quoteIdentifier(string $text)
MySQL documentation says that identifiers cannot contain '.'. |
|
setIdentifierQuoting($enabled = true)
|
from DefaultPlatform | |
getIdentifierQuoting()
|
from DefaultPlatform | |
boolean |
supportsNativeDeleteTrigger()
Whether RDBMS supports native ON DELETE triggers (e.g. |
|
boolean |
supportsInsertNullPk()
Whether RDBMS supports INSERT null values in autoincremented primary keys |
from DefaultPlatform |
boolean |
hasStreamBlobImpl()
Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings). |
from DefaultPlatform |
boolean |
supportsSchemas()
|
|
boolean |
supportsMigrations()
|
from DefaultPlatform |
boolean |
supportsVarcharWithoutSize()
Wether RDBMS supports VARCHAR without explicit size |
from DefaultPlatform |
mixed |
getBooleanString($b)
Returns the boolean value for the RDBMS. |
from DefaultPlatform |
getPhpArrayString($stringValue)
|
from DefaultPlatform | |
string |
getTimestampFormatter()
Gets the preferred timestamp formatter for setting date/time values. |
|
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 |
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. |
from DefaultPlatform | |
getDefaultFKOnDeleteBehavior()
|
||
getDefaultFKOnUpdateBehavior()
|
||
setTableEngineKeyword(string $tableEngineKeyword)
Setter for the tableEngineKeyword property |
||
string |
getTableEngineKeyword()
Getter for the tableEngineKeyword property |
|
setDefaultTableEngine(string $defaultTableEngine)
Setter for the defaultTableEngine property |
||
string |
getDefaultTableEngine()
Getter for the defaultTableEngine property |
|
supportsForeignKeys(Table $table)
|
||
string |
getChangeColumnDDL($fromColumn, $toColumn)
Builds the DDL SQL to change a column |
|
getAddColumnDDLBits(Column $column)
|
||
string |
disconnectedEscapeText(string $text)
Escape the string for RDBMS. |
Details
in DefaultPlatform at line 49
public
__construct(PDO $con = null)
Default constructor.
in DefaultPlatform at line 62
public
setConnection(PDO $con = null)
Set the database connection to use for this Platform class.
in DefaultPlatform at line 72
public PDO
getConnection()
Returns the database connection to use for this Platform class.
at line 53
public
setGeneratorConfig(GeneratorConfigInterface $generatorConfig)
Sets the GeneratorConfig to use in the parsing.
in DefaultPlatform at line 136
public string
getDatabaseType()
Returns the short name of the database type that this platform represents.
For example MysqlPlatform->getDatabaseType() returns 'mysql'.
at line 108
public int
getMaxColumnNameLength()
Returns the max column length supported by the db.
in DefaultPlatform at line 159
public string
getNativeIdMethod()
Returns the native IdMethod (sequence|identity)
in DefaultPlatform at line 164
public
isNativeIdMethodAutoIncrement()
in DefaultPlatform at line 177
public Domain
getDomainForType(string $propelType)
Returns the db specific domain for a propelType.
in DefaultPlatform at line 190
public string
getNullString($notNull)
at line 103
public The
getAutoIncrement()
in DefaultPlatform at line 213
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.
at line 132
public string
getAddTablesDDL(Database $database)
Builds the DDL SQL to add the tables of a database together with index and foreign keys
at line 145
public string
getBeginDDL()
Gets the requests to execute at the beginning of a DDL file
at line 154
public string
getEndDDL()
Gets the requests to execute at the end of a DDL file
at line 301
public string
getDropTableDDL(Table $table)
Builds the DDL SQL to drop a table
at line 189
public string
getAddTableDDL(Table $table)
Builds the DDL SQL to add a table without index and foreign keys
at line 308
public string
getColumnDDL(Column $col)
Builds the DDL SQL for a Column object.
in DefaultPlatform at line 362
public string
getColumnDefaultValueDDL(Column $col)
Returns the SQL for the default value of a Column object
in DefaultPlatform at line 408
public string
getColumnListDDL($columns, $delimiter = ',')
Creates a delimiter-delimited string list of column names, quoted using quoteIdentifier().
in DefaultPlatform at line 426
public string
getPrimaryKeyName(Table $table)
Returns the name of a table primary key
at line 167
public string
getPrimaryKeyDDL(Table $table)
Returns the SQL for the primary key of a Table object
at line 405
public string
getDropPrimaryKeyDDL(Table $table)
Builds the DDL SQL to drop the primary key of a table.
in DefaultPlatform at line 471
public string
getAddPrimaryKeyDDL(Table $table)
Builds the DDL SQL to add the primary key of a table.
in DefaultPlatform at line 490
public string
getAddIndicesDDL(Table $table)
Builds the DDL SQL to add the indices of a table.
at line 423
public string
getAddIndexDDL(Index $index)
Builds the DDL SQL to add an Index.
at line 444
public string
getDropIndexDDL(Index $index)
Builds the DDL SQL to drop an Index.
at line 461
public string
getIndexDDL(Index $index)
Builds the DDL SQL for an Index object.
at line 483
public string
getUniqueDDL(Unique $unique)
Builds the DDL SQL for a Unique constraint object.
in DefaultPlatform at line 568
public string
getAddForeignKeysDDL(Table $table)
Builds the DDL SQL to add the foreign keys of a table.
at line 491
public string
getAddForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL to add a foreign key.
at line 514
public string
getDropForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL to drop a foreign key.
at line 505
public string
getForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL for a ForeignKey object.
in DefaultPlatform at line 653
public
getCommentLineDDL($comment)
at line 529
public
getCommentBlockDDL($comment)
at line 546
public string
getModifyDatabaseDDL(PropelDatabaseDiff $databaseDiff)
Builds the DDL SQL to modify a database based on a PropelDatabaseDiff instance
at line 576
public string
getRenameTableDDL($fromTableName, $toTableName)
Builds the DDL SQL to rename a table
in DefaultPlatform at line 731
public string
getModifyTableDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a PropelTableDiff instance
in DefaultPlatform at line 796
public string
getModifyTableColumnsDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a PropelTableDiff instance
in DefaultPlatform at line 825
public string
getModifyTablePrimaryKeyDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table's primary key based on a PropelTableDiff instance
in DefaultPlatform at line 843
public string
getModifyTableIndicesDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table's indices based on a PropelTableDiff instance
in DefaultPlatform at line 870
public string
getModifyTableForeignKeysDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table's foreign keys based on a PropelTableDiff instance
at line 593
public string
getRemoveColumnDDL(Column $column)
Builds the DDL SQL to remove a column
at line 610
public string
getRenameColumnDDL($fromColumn, $toColumn)
Builds the DDL SQL to rename a column
at line 620
public string
getModifyColumnDDL(PropelColumnDiff $columnDiff)
Builds the DDL SQL to modify a column
at line 648
public string
getModifyColumnsDDL($columnDiffs)
Builds the DDL SQL to modify a list of columns
in DefaultPlatform at line 982
public string
getAddColumnDDL(Column $column)
Builds the DDL SQL to remove a column
at line 688
public string
getAddColumnsDDL($columns)
Builds the DDL SQL to add a list of columns
at line 721
public boolean
hasSize(string $sqlType)
Returns if the RDBMS-specific SQL type has a size attribute.
in DefaultPlatform at line 1042
public boolean
hasScale(string $sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute.
in DefaultPlatform at line 1054
public string
quote(string $text)
Quote and escape needed characters in the string for underlying RDBMS.
at line 752
public string
quoteIdentifier(string $text)
MySQL documentation says that identifiers cannot contain '.'.
Thus it
should be safe to split the string by '.' and quote each part individually
to allow for a
Whether RDBMS supports native ON DELETE triggers (e.g. ON DELETE CASCADE). Whether RDBMS supports INSERT null values in autoincremented primary keys
Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings).
Wether RDBMS supports VARCHAR without explicit size
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.
Gets the preferred timestamp formatter for setting date/time values.
Gets the preferred time formatter for setting date/time values.
Gets the preferred date formatter for setting date/time values.
Get the PHP snippet for binding a value to a column. Warning: duplicates logic from DBAdapter::bindValue().
Any code modification here must be ported there. Get the PHP snippet for getting a Pk from the database. Warning: duplicates logic from DBAdapter::getId().
Any code modification here must be ported there. Typical output:
Setter for the tableEngineKeyword property
Getter for the tableEngineKeyword property
Setter for the defaultTableEngine property
Getter for the defaultTableEngine property
Builds the DDL SQL to change a column
Escape the string for RDBMS.
or
.
public
setIdentifierQuoting($enabled = true)
public
getIdentifierQuoting()
public boolean
supportsNativeDeleteTrigger()
public boolean
supportsInsertNullPk()
public boolean
hasStreamBlobImpl()
public boolean
supportsSchemas()
public boolean
supportsMigrations()
public boolean
supportsVarcharWithoutSize()
public mixed
getBooleanString($b)
public
getPhpArrayString($stringValue)
public string
getTimestampFormatter()
public string
getTimeFormatter()
public string
getDateFormatter()
public
getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = ' ')
public
getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = ' ')
$this->id = $con->lastInsertId();
public
getDefaultFKOnDeleteBehavior()
public
getDefaultFKOnUpdateBehavior()
public
setTableEngineKeyword(string $tableEngineKeyword)
public string
getTableEngineKeyword()
public
setDefaultTableEngine(string $defaultTableEngine)
public string
getDefaultTableEngine()
public
supportsForeignKeys(Table $table)
public string
getChangeColumnDDL($fromColumn, $toColumn)
public
getAddColumnDDLBits(Column $column)
public string
disconnectedEscapeText(string $text)