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) | ||
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 |
isNativeIdMethodAutoIncrement() | from DefaultPlatform | |
Domain |
getDomainForType(string $propelType)
Returns the db specific domain for a propelType. |
from DefaultPlatform |
string | getNullString($notNull) | from DefaultPlatform |
getAutoIncrement() | ||
string |
getSequenceName(Table $table)
Gets the name to use for creating a sequence for a table. |
from DefaultPlatform |
getAddTablesDDL(Database $database) | ||
getBeginDDL() | ||
getEndDDL() | ||
getDropTableDDL(Table $table) | ||
getAddTableDDL(Table $table) | ||
getColumnDDL(Column $col) | ||
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. |
|
getUniqueDDL(Unique $unique) | ||
string |
getAddForeignKeysDDL(Table $table)
Builds the DDL SQL to add the foreign keys of a table. |
from DefaultPlatform |
getAddForeignKeyDDL(ForeignKey $fk) | ||
getDropForeignKeyDDL(ForeignKey $fk) | ||
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 |
|
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 |
string |
quoteIdentifier(string $text)
MySQL documentation says that identifiers cannot contain '.'. |
|
setIdentifierQuoting($enabled = true) | from DefaultPlatform | |
getIdentifierQuoting() | from DefaultPlatform | |
supportsNativeDeleteTrigger() | ||
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 |
supportsSchemas() | ||
supportsMigrations() | from DefaultPlatform | |
supportsVarcharWithoutSize() | from DefaultPlatform | |
mixed |
getBooleanString($b)
Returns the boolean value for the RDBMS. |
from DefaultPlatform |
getPhpArrayString($stringValue) | 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 |
getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = ' ') | ||
getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = ' ')
Get the PHP snippet for getting a Pk from the database. |
from DefaultPlatform | |
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 48
public
__construct(PDO $con = null)
Default constructor.
in DefaultPlatform at line 58
public
setConnection(PDO $con = null)
Set the database connection to use for this Platform class.
in DefaultPlatform at line 67
public PDO
getConnection()
Returns the database connection to use for this Platform class.
at line 53
public
setGeneratorConfig(GeneratorConfigInterface $generatorConfig)
in DefaultPlatform at line 128
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
getMaxColumnNameLength()
in DefaultPlatform at line 151
public string
getNativeIdMethod()
Returns the native IdMethod (sequence|identity)
in DefaultPlatform at line 156
public
isNativeIdMethodAutoIncrement()
in DefaultPlatform at line 168
public Domain
getDomainForType(string $propelType)
Returns the db specific domain for a propelType.
in DefaultPlatform at line 181
public string
getNullString($notNull)
at line 103
public
getAutoIncrement()
in DefaultPlatform at line 204
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 131
public
getAddTablesDDL(Database $database)
at line 144
public
getBeginDDL()
at line 153
public
getEndDDL()
at line 299
public
getDropTableDDL(Table $table)
at line 187
public
getAddTableDDL(Table $table)
at line 306
public
getColumnDDL(Column $col)
in DefaultPlatform at line 354
public string
getColumnDefaultValueDDL(Column $col)
Returns the SQL for the default value of a Column object
in DefaultPlatform at line 398
public string
getColumnListDDL($columns, $delimiter = ',')
Creates a delimiter-delimited string list of column names, quoted using quoteIdentifier().
in DefaultPlatform at line 415
public string
getPrimaryKeyName(Table $table)
Returns the name of a table primary key
at line 165
public string
getPrimaryKeyDDL(Table $table)
Returns the SQL for the primary key of a Table object
at line 400
public string
getDropPrimaryKeyDDL(Table $table)
Builds the DDL SQL to drop the primary key of a table.
in DefaultPlatform at line 457
public string
getAddPrimaryKeyDDL(Table $table)
Builds the DDL SQL to add the primary key of a table.
in DefaultPlatform at line 475
public string
getAddIndicesDDL(Table $table)
Builds the DDL SQL to add the indices of a table.
at line 417
public string
getAddIndexDDL(Index $index)
Builds the DDL SQL to add an Index.
at line 437
public string
getDropIndexDDL(Index $index)
Builds the DDL SQL to drop an Index.
at line 453
public string
getIndexDDL(Index $index)
Builds the DDL SQL for an Index object.
at line 475
public
getUniqueDDL(Unique $unique)
in DefaultPlatform at line 554
public string
getAddForeignKeysDDL(Table $table)
Builds the DDL SQL to add the foreign keys of a table.
at line 484
public
getAddForeignKeyDDL(ForeignKey $fk)
at line 506
public
getDropForeignKeyDDL(ForeignKey $fk)
at line 497
public string
getForeignKeyDDL(ForeignKey $fk)
Builds the DDL SQL for a ForeignKey object.
in DefaultPlatform at line 636
public
getCommentLineDDL($comment)
at line 521
public
getCommentBlockDDL($comment)
at line 538
public string
getModifyDatabaseDDL(PropelDatabaseDiff $databaseDiff)
Builds the DDL SQL to modify a database based on a PropelDatabaseDiff instance
at line 567
public string
getRenameTableDDL($fromTableName, $toTableName)
Builds the DDL SQL to rename a table
in DefaultPlatform at line 713
public string
getModifyTableDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a PropelTableDiff instance
in DefaultPlatform at line 778
public string
getModifyTableColumnsDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table based on a PropelTableDiff instance
in DefaultPlatform at line 807
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 825
public string
getModifyTableIndicesDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table's indices based on a PropelTableDiff instance
in DefaultPlatform at line 852
public string
getModifyTableForeignKeysDDL(PropelTableDiff $tableDiff)
Builds the DDL SQL to alter a table's foreign keys based on a PropelTableDiff instance
at line 584
public string
getRemoveColumnDDL(Column $column)
Builds the DDL SQL to remove a column
at line 600
public string
getRenameColumnDDL($fromColumn, $toColumn)
Builds the DDL SQL to rename a column
at line 610
public string
getModifyColumnDDL(PropelColumnDiff $columnDiff)
Builds the DDL SQL to modify a column
at line 637
public string
getModifyColumnsDDL($columnDiffs)
Builds the DDL SQL to modify a list of columns
in DefaultPlatform at line 963
public string
getAddColumnDDL(Column $column)
Builds the DDL SQL to remove a column
at line 677
public string
getAddColumnsDDL($columns)
Builds the DDL SQL to add a list of columns
at line 710
public
hasSize($sqlType)
in DefaultPlatform at line 1024
public boolean
hasScale(string $sqlType)
Returns if the RDBMS-specific SQL type has a scale attribute.
in DefaultPlatform at line 1034
public string
quote(string $text)
Quote and escape needed characters in the string for unerlying RDBMS.
at line 740
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 <schema>.<table> or <table>.<column> syntax.
in DefaultPlatform at line 1067
public
setIdentifierQuoting($enabled = true)
in DefaultPlatform at line 1072
public
getIdentifierQuoting()
at line 113
public
supportsNativeDeleteTrigger()
in DefaultPlatform at line 1090
public boolean
supportsInsertNullPk()
Whether RDBMS supports INSERT null values in autoincremented primary keys
in DefaultPlatform at line 1099
public boolean
hasStreamBlobImpl()
Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings).
at line 705
public
supportsSchemas()
in DefaultPlatform at line 1115
public
supportsMigrations()
in DefaultPlatform at line 1121
public
supportsVarcharWithoutSize()
in DefaultPlatform at line 1137
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.
in DefaultPlatform at line 1144
public
getPhpArrayString($stringValue)
at line 745
public
getTimestampFormatter()
in DefaultPlatform at line 1178
public string
getTimeFormatter()
Gets the preferred time formatter for setting date/time values.
in DefaultPlatform at line 1187
public string
getDateFormatter()
Gets the preferred date formatter for setting date/time values.
at line 750
public
getColumnBindingPHP($column, $identifier, $columnValueAccessor, $tab = ' ')
in DefaultPlatform at line 1233
public
getIdentifierPhp($columnValueMutator, $connectionVariableName = '$con', $sequenceName = '', $tab = ' ')
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:
<code>
$this->id = $con->lastInsertId();
</code>
at line 68
public
setTableEngineKeyword(string $tableEngineKeyword)
Setter for the tableEngineKeyword property
at line 78
public string
getTableEngineKeyword()
Getter for the tableEngineKeyword property
at line 88
public
setDefaultTableEngine(string $defaultTableEngine)
Setter for the defaultTableEngine property
at line 98
public string
getDefaultTableEngine()
Getter for the defaultTableEngine property
at line 118
public
supportsForeignKeys(Table $table)
at line 619
public string
getChangeColumnDDL($fromColumn, $toColumn)
Builds the DDL SQL to change a column
at line 647
public
getAddColumnDDLBits(Column $column)
at line 722
public string
disconnectedEscapeText(string $text)
Escape the string for RDBMS.