Propel 2 API
Interface

Propel\Runtime\Adapter\AdapterInterface

interface AdapterInterface

Interface for adapters.

Constants

ID_METHOD_NONE

ID_METHOD_AUTOINCREMENT

ID_METHOD_SEQUENCE

Methods

ConnectionInterface getConnection(array $conparams)

Build database connection

setCharset(ConnectionInterface $con, string $charset)

Sets the character encoding using SQL standard SET NAMES statement.

string ignoreCaseInOrderBy(string $in)

This method is used to ignore case in an ORDER BY clause.

string getStringDelimiter()

Returns the character used to indicate the beginning and end of a piece of text used in a SQL statement (generally a single quote).

string concatString(string $s1, string $s2)

Returns SQL which concatenates the second string to the first.

string subString(string $s, integer $pos, integer $len)

Returns SQL which extracts a substring.

string strLength(string $s)

Returns SQL which calculates the length (in chars) of a string.

string quoteIdentifier(string $text)

Quotes database object identifiers (table names, col names, sequences, etc.).

string quoteIdentifierTable(string $table)

Quotes a database table which could have space separating it from an alias, both should be identified separately.

boolean isGetIdBeforeInsert()

Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.

boolean isGetIdAfterInsert()

Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.

mixed getId(ConnectionInterface $con, string $name = null)

Gets the generated ID (either last ID for autoincrement or next sequence ID).

string formatTemporalValue(mixed $value, ColumnMap $cMap)

Formats a temporal value before binding, given a ColumnMap object

string getTimestampFormatter()

Returns timestamp formatter string for use in date() function.

string getDateFormatter()

Returns date formatter string for use in date() function.

string getTimeFormatter()

Returns time formatter string for use in date() function.

useQuoteIdentifier()

Should Column-Names get identifiers for inserts or updates.

Details

at line 33
public ConnectionInterface getConnection(array $conparams)

Build database connection

Parameters

array $conparams connection parameters

Return Value

ConnectionInterface

at line 46
public setCharset(ConnectionInterface $con, string $charset)

Sets the character encoding using SQL standard SET NAMES statement.

This method is invoked from the default initConnection() method and must
be overridden for an RDMBS which does _not_ support this SQL standard.

Parameters

ConnectionInterface $con
string $charset The $string charset encoding.

See also

initConnection()

at line 57
public string ignoreCaseInOrderBy(string $in)

This method is used to ignore case in an ORDER BY clause.

Usually it is the same as ignoreCase, but some databases
(Interbase for example) does not use the same SQL in ORDER BY
and other clauses.

Parameters

string $in The string whose case to ignore.

Return Value

string The string in a case that can be ignored.

at line 66
public string getStringDelimiter()

Returns the character used to indicate the beginning and end of a piece of text used in a SQL statement (generally a single quote).

Return Value

string The text delimiter.

at line 76
public string concatString(string $s1, string $s2)

Returns SQL which concatenates the second string to the first.

Parameters

string $s1 String to concatenate.
string $s2 String to append.

Return Value

string

at line 87
public string subString(string $s, integer $pos, integer $len)

Returns SQL which extracts a substring.

Parameters

string $s String to extract from.
integer $pos Offset to start from.
integer $len Number of characters to extract.

Return Value

string

at line 95
public string strLength(string $s)

Returns SQL which calculates the length (in chars) of a string.

Parameters

string $s String to calculate length of.

Return Value

string

at line 102
public string quoteIdentifier(string $text)

Quotes database object identifiers (table names, col names, sequences, etc.).

Parameters

string $text The identifier to quote.

Return Value

string The quoted identifier.

at line 113
public string quoteIdentifierTable(string $table)

Quotes a database table which could have space separating it from an alias, both should be identified separately.

This doesn't take care of dots which
separate schema names from table names. Adapters for RDBMs which support
schemas have to implement that in the platform-specific way.

Parameters

string $table The table name to quo

Return Value

string The quoted table name

at line 120
public boolean isGetIdBeforeInsert()

Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.

Return Value

boolean

at line 127
public boolean isGetIdAfterInsert()

Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.

Return Value

boolean

at line 137
public mixed getId(ConnectionInterface $con, string $name = null)

Gets the generated ID (either last ID for autoincrement or next sequence ID).

Parameters

ConnectionInterface $con
string $name

Return Value

mixed

at line 147
public string formatTemporalValue(mixed $value, ColumnMap $cMap)

Formats a temporal value before binding, given a ColumnMap object

Parameters

mixed $value The temporal value
ColumnMap $cMap

Return Value

string The formatted temporal value

at line 154
public string getTimestampFormatter()

Returns timestamp formatter string for use in date() function.

Return Value

string

at line 161
public string getDateFormatter()

Returns date formatter string for use in date() function.

Return Value

string

at line 168
public string getTimeFormatter()

Returns time formatter string for use in date() function.

Return Value

string

at line 181
public useQuoteIdentifier()

Should Column-Names get identifiers for inserts or updates.

By default false is returned -> backwards compatibility.

it`s a workaround...!!!