abstract class PdoAdapter
Base for PDO database adapters.
Methods
PdoConnection |
getConnection(array $conparams)
Build database connection |
|
initConnection(ConnectionInterface $con, array $settings)
This method is called after a connection was created to run necessary post-initialization queries or code. |
||
setCharset(ConnectionInterface $con, string $charset)
Sets the character encoding using SQL standard SET NAMES statement. |
||
string |
toUpperCase(string $in)
This method is used to ignore case. |
|
string |
ignoreCase(string $in)
This method is used to ignore case. |
|
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 |
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. |
||
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)
Allows manipulation of the query string before StatementPdo is instantiated. |
||
string |
getDeleteFromClause(Criteria $criteria, string $tableName)
Returns the "DELETE FROM <table> [AS <alias>]" part of DELETE query. |
|
string |
createSelectSqlPart(Criteria $criteria, array $fromClause, boolean $aliasAll = false)
Builds the SELECT part of a SQL statement based on a Criteria taking into account select columns and 'as' columns (i.e. |
|
Criteria |
turnSelectColumnsToAliases(Criteria $criteria)
Ensures uniqueness of select column names by turning them all into aliases This is necessary for queries on more than one table when the tables share a column name |
|
bindValues(StatementInterface $stmt, array $params, DatabaseMap $dbMap)
Binds values in a prepared statement. |
||
boolean |
bindValue(StatementInterface $stmt, string $parameter, mixed $value, ColumnMap $cMap, null|integer $position = null)
Binds a value to a positioned parameter in a statement, given a ColumnMap object to infer the binding type. |
Details
at line 40
public PdoConnection
getConnection(array $conparams)
Build database connection
at line 104
public
initConnection(ConnectionInterface $con, array $settings)
This method is called after a connection was created to run necessary post-initialization queries or code.
If a charset was specified, this will be set before any other queries
are executed.
This base method runs queries specified using the "query" setting.
at line 130
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.
at line 141
public string
toUpperCase(string $in)
This method is used to ignore case.
at line 152
public string
ignoreCase(string $in)
This method is used to ignore case.
at line 166
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.
at line 178
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).
at line 188
public string
quoteIdentifier(string $text)
Quotes database object identifiers (table names, col names, sequences, etc.).
at line 202
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.
at line 222
public boolean
isGetIdBeforeInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.
at line 232
public boolean
isGetIdAfterInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.
at line 245
public mixed
getId(ConnectionInterface $con, string $name = null)
Gets the generated ID (either last ID for autoincrement or next sequence ID).
at line 258
public string
formatTemporalValue(mixed $value, ColumnMap $cMap)
Formats a temporal value before binding, given a ColumnMap object
at line 285
public string
getTimestampFormatter()
Returns timestamp formatter string for use in date() function.
at line 295
public string
getDateFormatter()
Returns date formatter string for use in date() function.
at line 305
public string
getTimeFormatter()
Returns time formatter string for use in date() function.
at line 320
public
useQuoteIdentifier()
Should Column-Names get identifiers for inserts or updates.
By default false is returned -> backwards compatibility.
it`s a workaround...!!!
at line 333
public
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)
Allows manipulation of the query string before StatementPdo is instantiated.
at line 345
public string
getDeleteFromClause(Criteria $criteria, string $tableName)
Returns the "DELETE FROM <table> [AS <alias>]" part of DELETE query.
at line 377
public string
createSelectSqlPart(Criteria $criteria, array $fromClause, boolean $aliasAll = false)
Builds the SELECT part of a SQL statement based on a Criteria taking into account select columns and 'as' columns (i.e.
columns aliases)
at line 448
public Criteria
turnSelectColumnsToAliases(Criteria $criteria)
Ensures uniqueness of select column names by turning them all into aliases This is necessary for queries on more than one table when the tables share a column name
at line 498
public
bindValues(StatementInterface $stmt, array $params, DatabaseMap $dbMap)
Binds values in a prepared statement.
This method is designed to work with the Criteria::createSelectSql() method, which creates
both the SELECT SQL statement and populates a passed-in array of parameter
values that should be substituted.
<code>
$adapter = Propel::getServiceContainer()->getAdapter($criteria->getDbName());
$sql = $criteria->createSelectSql($params);
$stmt = $con->prepare($sql);
$params = array();
$adapter->populateStmtValues($stmt, $params, Propel::getServiceContainer()->getDatabaseMap($critera->getDbName()));
$stmt->execute();
</code>
at line 532
public boolean
bindValue(StatementInterface $stmt, string $parameter, mixed $value, ColumnMap $cMap, null|integer $position = null)
Binds a value to a positioned parameter in a statement, given a ColumnMap object to infer the binding type.