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) : stringParameters| Name | Type | Description |
|---|
| $value | string | Raw string |
|---|
Returns| Type | Description |
|---|
| string | Quoted string |



exec(mixed $sql) : integerExecutes an SQL statement and return the number of affected rows
Parameters| Name | Type | Description |
|---|
| $sql | mixed | The SQL statement with placeholders.
May be a string or Zend_Db_Select. |
|---|
Returns| Type | Description |
|---|
| integer | Number of rows that were modified
or deleted by the SQL statement |



lastInsertId(string $tableName = null, string $primaryKey = null) : stringGets 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.
Parameters| Name | Type | Description |
|---|
| $tableName | string | OPTIONAL Name of table. |
|---|
| $primaryKey | string | OPTIONAL Name of primary key column. |
|---|
Returns


prepare(string $sql) : \PDOStatementPrepares an SQL statement.
Parameters| Name | Type | Description |
|---|
| $sql | string | The SQL statement with placeholders. |
|---|
Returns 


query(string | \Zend_Db_Select $sql, array $bind = array()) : \Zend_Db_Statement_PdoSpecial handling for PDO query().
All bind parameter names must begin with ':'
Parameters| Name | Type | Description |
|---|
| $sql | string | \Zend_Db_Select | The SQL statement with placeholders. |
|---|
| $bind | array | An array of data to bind to the placeholders. |
|---|
ReturnsThrows


setFetchMode(int $mode) : voidParameters| Name | Type | Description |
|---|
| $mode | int | A PDO fetch mode. |
|---|
ThrowsDetails- Todo
- Support FETCH_CLASS and FETCH_INTO.



supportsParameters(string $type) : boolCheck if the adapter supports real SQL parameters.
Parameters| Name | Type | Description |
|---|
| $type | string | 'positional' or 'named' |
|---|
Returns