interface SqlAdapterInterface implements AdapterInterface
Interface for adapters.
Methods
ConnectionInterface |
getConnection(array $conparams)
Build database connection |
from AdapterInterface |
setCharset(ConnectionInterface $con, string $charset)
Sets the character encoding using SQL standard SET NAMES statement. |
from AdapterInterface | |
string |
ignoreCaseInOrderBy(string $in)
This method is used to ignore case in an ORDER BY clause. |
from AdapterInterface |
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). |
from AdapterInterface |
string |
concatString(string $s1, string $s2)
Returns SQL which concatenates the second string to the first. |
from AdapterInterface |
string |
subString(string $s, integer $pos, integer $len)
Returns SQL which extracts a substring. |
from AdapterInterface |
string |
strLength(string $s)
Returns SQL which calculates the length (in chars) of a string. |
from AdapterInterface |
string |
quoteIdentifier(string $text)
Quotes database object identifiers (table names, col names, sequences, etc.). |
from AdapterInterface |
string |
quoteIdentifierTable(string $table)
Quotes a database table which could have space separating it from an alias, both should be identified separately. |
from AdapterInterface |
boolean |
isGetIdBeforeInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT. |
from AdapterInterface |
boolean |
isGetIdAfterInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT. |
from AdapterInterface |
mixed |
getId(ConnectionInterface $con, string $name = null)
Gets the generated ID (either last ID for autoincrement or next sequence ID). |
from AdapterInterface |
string |
formatTemporalValue(mixed $value, ColumnMap $cMap)
Formats a temporal value before binding, given a ColumnMap object |
from AdapterInterface |
string |
getTimestampFormatter()
Returns timestamp formatter string for use in date() function. |
from AdapterInterface |
string |
getDateFormatter()
Returns date formatter string for use in date() function. |
from AdapterInterface |
string |
getTimeFormatter()
Returns time formatter string for use in date() function. |
from AdapterInterface |
useQuoteIdentifier()
Should Column-Names get identifiers for inserts or updates. |
from AdapterInterface | |
string |
toUpperCase(string $in)
This method is used to ignore case. |
|
string |
ignoreCase(string $in)
This method is used to ignore case. |
|
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)
Allows manipulation of the query string before StatementPdo is instantiated. |
||
applyLimit(string $sql, integer $offset, integer $limit)
Modifies the passed-in SQL to add LIMIT and/or OFFSET. |
||
random(mixed $seed = null)
Gets the SQL string that this adapter uses for getting a random number. |
||
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
in AdapterInterface at line 33
public ConnectionInterface
getConnection(array $conparams)
Build database connection
in AdapterInterface 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.
in AdapterInterface 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.
in AdapterInterface 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).
in AdapterInterface at line 76
public string
concatString(string $s1, string $s2)
Returns SQL which concatenates the second string to the first.
in AdapterInterface at line 87
public string
subString(string $s, integer $pos, integer $len)
Returns SQL which extracts a substring.
in AdapterInterface at line 95
public string
strLength(string $s)
Returns SQL which calculates the length (in chars) of a string.
in AdapterInterface at line 102
public string
quoteIdentifier(string $text)
Quotes database object identifiers (table names, col names, sequences, etc.).
in AdapterInterface 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.
in AdapterInterface at line 120
public boolean
isGetIdBeforeInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.
in AdapterInterface at line 127
public boolean
isGetIdAfterInsert()
Whether this adapter uses an ID generation system that requires getting ID _before_ performing INSERT.
in AdapterInterface at line 137
public mixed
getId(ConnectionInterface $con, string $name = null)
Gets the generated ID (either last ID for autoincrement or next sequence ID).
in AdapterInterface at line 147
public string
formatTemporalValue(mixed $value, ColumnMap $cMap)
Formats a temporal value before binding, given a ColumnMap object
in AdapterInterface at line 154
public string
getTimestampFormatter()
Returns timestamp formatter string for use in date() function.
in AdapterInterface at line 161
public string
getDateFormatter()
Returns date formatter string for use in date() function.
in AdapterInterface at line 168
public string
getTimeFormatter()
Returns time formatter string for use in date() function.
in AdapterInterface 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...!!!
at line 31
public string
toUpperCase(string $in)
This method is used to ignore case.
at line 39
public string
ignoreCase(string $in)
This method is used to ignore case.
at line 49
public
cleanupSQL(string $sql, array $params, Criteria $values, DatabaseMap $dbMap)
Allows manipulation of the query string before StatementPdo is instantiated.
at line 58
public
applyLimit(string $sql, integer $offset, integer $limit)
Modifies the passed-in SQL to add LIMIT and/or OFFSET.
at line 65
public
random(mixed $seed = null)
Gets the SQL string that this adapter uses for getting a random number.
at line 75
public string
getDeleteFromClause(Criteria $criteria, string $tableName)
Returns the "DELETE FROM <table> [AS <alias>]" part of DELETE query.
at line 87
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 98
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 120
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($criteria->getDbName()));
$stmt->execute();
</code>
at line 134
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.