Propel 2 API
Interface

Propel\Generator\Platform\PlatformInterface

interface PlatformInterface

Interface for RDBMS platform specific behaviour.

Constants

IDENTITY

Constant for auto-increment id method.

SEQUENCE

Constant for sequence id method.

SERIAL

Constant for serial id method (postgresql).

Methods

setConnection(ConnectionInterface $con = null)

Sets a database connection to use (for quoting, etc.).

ConnectionInterface getConnection()

Returns the database connection to use for this Platform class.

setGeneratorConfig(GeneratorConfigInterface $config)

Sets the GeneratorConfigInterface which contains any generator build properties.

string getDatabaseType()

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

string getNativeIdMethod()

Returns the native IdMethod (sequence|identity)

int getMaxColumnNameLength()

Returns the max column length supported by the db.

Domain getDomainForType(string $propelType)

Returns the db specific domain for a propelType.

string getNullString($notNull)

The getAutoIncrement()

string getColumnDDL(Column $col)

Returns 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 getPrimaryKeyDDL(Table $table)

Returns the SQL for the primary key of a Table object

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.

boolean supportsNativeDeleteTrigger()

Whether RDBMS supports native ON DELETE triggers (e.g.

boolean supportsInsertNullPk()

Whether RDBMS supports INSERT null values in autoincremented primary keys

boolean supportsSchemas()

Whether RDBMS supports native schemas for table layout.

boolean supportsMigrations()

Whether RDBMS supports migrations.

boolean supportsVarcharWithoutSize()

Whether RDBMS supports VARCHAR without explicit size

mixed getBooleanString(mixed $tf)

Returns the boolean value for the RDBMS.

boolean hasStreamBlobImpl()

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

string getTimestampFormatter()

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

string getDateFormatter()

Gets the preferred date formatter for setting time values.

string getTimeFormatter()

Gets the preferred time formatter for setting time values.

Details

at line 46
public setConnection(ConnectionInterface $con = null)

Sets a database connection to use (for quoting, etc.).

Parameters

ConnectionInterface $con The database connection to use in this Platform class.

at line 52
public ConnectionInterface getConnection()

Returns the database connection to use for this Platform class.

Return Value

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

at line 59
public setGeneratorConfig(GeneratorConfigInterface $config)

Sets the GeneratorConfigInterface which contains any generator build properties.

Parameters

GeneratorConfigInterface $config

at line 66
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 73
public string getNativeIdMethod()

Returns the native IdMethod (sequence|identity)

Return Value

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

at line 80
public int getMaxColumnNameLength()

Returns the max column length supported by the db.

Return Value

int The max column length

at line 88
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 94
public string getNullString($notNull)

Parameters

$notNull

Return Value

string The RDBMS-specific SQL fragment for <code>NULL</code> or <code>NOT NULL</code>.

at line 99
public The getAutoIncrement()

Return Value

The RDBMS-specific SQL fragment for autoincrement.

at line 105
public string getColumnDDL(Column $col)

Returns the DDL SQL for a Column object.

Parameters

Column $col

Return Value

string

at line 111
public string getColumnDefaultValueDDL(Column $col)

Returns the SQL for the default value of a Column object.

Parameters

Column $col

Return Value

string

at line 125
public string getColumnListDDL(Column[]|string[] $columns, string $delimiter = ',')

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

Parameters

Column[]|string[] $columns
string $delimiter The delimiter to use in separating the column names.

Return Value

string

at line 131
public string getPrimaryKeyDDL(Table $table)

Returns the SQL for the primary key of a Table object

Parameters

Table $table

Return Value

string

at line 139
public boolean hasSize(string $sqlType)

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

Parameters

string $sqlType the SQL type

Return Value

boolean True if the type has a size attribute

at line 147
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

at line 154
public string quote(string $text)

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

Parameters

string $text

Return Value

string

at line 161
public string quoteIdentifier(string $text)

Quotes identifiers used in database SQL.

Parameters

string $text

Return Value

string Quoted identifier.

at line 167
public boolean supportsNativeDeleteTrigger()

Whether RDBMS supports native ON DELETE triggers (e.g.

ON DELETE CASCADE).

Return Value

boolean

at line 173
public boolean supportsInsertNullPk()

Whether RDBMS supports INSERT null values in autoincremented primary keys

Return Value

boolean

at line 179
public boolean supportsSchemas()

Whether RDBMS supports native schemas for table layout.

Return Value

boolean

at line 185
public boolean supportsMigrations()

Whether RDBMS supports migrations.

Return Value

boolean

at line 191
public boolean supportsVarcharWithoutSize()

Whether RDBMS supports VARCHAR without explicit size

Return Value

boolean

at line 205
public mixed getBooleanString(mixed $tf)

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

mixed $tf A boolean or string representation of boolean ('y', 'true').

Return Value

mixed

at line 211
public boolean hasStreamBlobImpl()

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

Return Value

boolean

at line 217
public string getTimestampFormatter()

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

Return Value

string

at line 223
public string getDateFormatter()

Gets the preferred date formatter for setting time values.

Return Value

string

at line 229
public string getTimeFormatter()

Gets the preferred time formatter for setting time values.

Return Value

string