[ Index ] |
|
Code source de Symfony 1.0.0 |
[Code source] [Imprimer] [Statistiques]
Class that represents a shared code for handling emulated pre-compiled statements. Many drivers do not take advantage of pre-compiling SQL statements; for these cases the precompilation is emulated. This emulation comes with slight penalty involved in parsing the queries, but provides other benefits such as a cleaner object model and ability to work with BLOB and CLOB values w/o needing special LOB-specific routines.
Author: | Hans Lellelid <hans@xmpl.org> |
Version: | $Revision: 1.16 $ |
Poids: | 640 lignes (19 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
__construct(Connection $conn, $sql) X-Ref |
Create new prepared statement instance. param: object $conn Connection object param: string $sql The SQL to work with. param: array $positions The positions in SQL of ?'s. param: restult $stmt If the driver supports prepared queries, then $stmt will contain the statement to use. |
parseQuery( $sql ) X-Ref |
Parse the SQL query for ? positions param: string $sql The query to process return: array Positions from the start of the string that ?'s appear at |
setLimit($v) X-Ref |
getLimit() X-Ref |
setOffset($v) X-Ref |
getOffset() X-Ref |
getResultSet() X-Ref |
getUpdateCount() X-Ref |
getMoreResults() X-Ref |
getConnection() X-Ref |
getResource() X-Ref |
Statement resources do not exist for emulated prepared statements, so this just returns <code>null</code>. return: null |
close() X-Ref |
Nothing to close for emulated prepared statements. |
replaceParams() X-Ref |
Replaces placeholders with the specified parameter values in the SQL. This is for emulated prepared statements. return: string New SQL statement with parameters replaced. |
executeQuery($p1 = null, $fetchmode = null) X-Ref |
Executes the SQL query in this PreparedStatement object and returns the resultset generated by the query. We support two signatures for this method: - $stmt->executeQuery(ResultSet::FETCHMODE_NUM); - $stmt->executeQuery(array($param1, $param2), ResultSet::FETCHMODE_NUM); param: mixed $p1 Either (array) Parameters that will be set using PreparedStatement::set() before query is executed or (int) fetchmode. param: int $fetchmode The mode to use when fetching the results (e.g. ResultSet::FETCHMODE_NUM, ResultSet::FETCHMODE_ASSOC). return: ResultSet |
executeUpdate($params = null) X-Ref |
Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object. param: array $params Parameters that will be set using PreparedStatement::set() before query is executed. return: int Number of affected rows (or 0 for drivers that return nothing). |
set($paramIndex, $value) X-Ref |
A generic set method. You can use this if you don't want to concern yourself with the details. It involves slightly more overhead than the specific settesr, since it grabs the PHP type to determine which method makes most sense. param: int $paramIndex param: mixed $value return: void |
setArray($paramIndex, $value) X-Ref |
Sets an array. Unless a driver-specific method is used, this means simply serializing the passed parameter and storing it as a string. param: int $paramIndex param: array $value return: void |
setBoolean($paramIndex, $value) X-Ref |
Sets a boolean value. Default behavior is true = 1, false = 0. param: int $paramIndex param: boolean $value return: void |
setBlob($paramIndex, $blob) X-Ref |
setClob($paramIndex, $clob) X-Ref |
setDate($paramIndex, $value) X-Ref |
param: int $paramIndex param: string $value return: void |
setDecimal($paramIndex, $value) X-Ref |
param: int $paramIndex param: double $value return: void |
setDouble($paramIndex, $value) X-Ref |
param: int $paramIndex param: double $value return: void |
setFloat($paramIndex, $value) X-Ref |
param: int $paramIndex param: float $value return: void |
setInt($paramIndex, $value) X-Ref |
param: int $paramIndex param: int $value return: void |
setInteger($paramIndex, $value) X-Ref |
Alias for setInt() param: int $paramIndex param: int $value |
setNull($paramIndex) X-Ref |
param: int $paramIndex return: void |
setString($paramIndex, $value) X-Ref |
param: int $paramIndex param: string $value return: void |
setTime($paramIndex, $value) X-Ref |
param: int $paramIndex param: string $value return: void |
setTimestamp($paramIndex, $value) X-Ref |
param: int $paramIndex param: string $value return: void |
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |