Db/Adapter/Pdo/Abstract.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Db
- Subpackage
- Adapter
- Version
- $Id$
\Zend_Db_Adapter_Pdo_Abstract
Package: Zend_Db\AdapterClass for connecting to SQL databases and performing common operations using PDO.
- Parent(s)
- \Zend_Db_Adapter_Abstract
- Children
- \Zend_Db_Adapter_Pdo_Mssql
- \Zend_Db_Adapter_Pdo_Pgsql
- \Zend_Db_Adapter_Pdo_Ibm
- \Zend_Db_Adapter_Pdo_Oci
- \Zend_Db_Adapter_Pdo_Mysql
- \Zend_Db_Adapter_Pdo_Sqlite
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties
string $_defaultStmtClass = 'Zend_Db_Statement_Pdo'
Default class name for a DB statement.
Default value'Zend_Db_Statement_Pdo'
Details- Type
- string
Methods
_quote(string $value) : string
ParametersName | Type | Description |
---|
$value | string | Raw string |
---|
ReturnsType | Description |
---|
string | Quoted string |
exec(mixed $sql) : integer
Executes an SQL statement and return the number of affected rows
ParametersName | Type | Description |
---|
$sql | mixed | The SQL statement with placeholders.
May be a string or Zend_Db_Select. |
---|
ReturnsType | Description |
---|
integer | Number of rows that were modified
or deleted by the SQL statement |
lastInsertId(string $tableName = null, string $primaryKey = null) : string
Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
As a convention, on RDBMS brands that support sequences
(e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
from the arguments and returns the last id generated by that sequence.
On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
returns the last value generated for such a column, and the table name
argument is disregarded.
On RDBMS brands that don't support sequences, $tableName and $primaryKey
are ignored.
ParametersName | Type | Description |
---|
$tableName | string | OPTIONAL Name of table. |
---|
$primaryKey | string | OPTIONAL Name of primary key column. |
---|
Returnsprepare(string $sql) : \PDOStatement
Prepares an SQL statement.
ParametersName | Type | Description |
---|
$sql | string | The SQL statement with placeholders. |
---|
Returns query(string | \Zend_Db_Select $sql, array $bind = array()) : \Zend_Db_Statement_Pdo
Special handling for PDO query().
All bind parameter names must begin with ':'
ParametersName | Type | Description |
---|
$sql | string | \Zend_Db_Select | The SQL statement with placeholders. |
---|
$bind | array | An array of data to bind to the placeholders. |
---|
ReturnsThrowssetFetchMode(int $mode) : void
ParametersName | Type | Description |
---|
$mode | int | A PDO fetch mode. |
---|
ThrowsDetails- Todo
- Support FETCH_CLASS and FETCH_INTO.
supportsParameters(string $type) : bool
Check if the adapter supports real SQL parameters.
ParametersName | Type | Description |
---|
$type | string | 'positional' or 'named' |
---|
Returns