API Documentation

Db/Adapter/Pdo/Abstract.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Adapter
version
$Id: Abstract.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Db_Adapter_Pdo_Abstract

Description

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.

Zend_Db_Adapter_Pdo_Abstract

Extends from
Zend_Db_Adapter_Abstract
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Adapter
Properties
$_defaultStmtClass
Methods
_dsn
_connect
isConnected
closeConnection
prepare
lastInsertId
query
exec
_quote
_beginTransaction
_commit
_rollBack
setFetchMode
supportsParameters
getServerVersion

Description

Class for connecting to SQL databases and performing common operations using PDO.

Properties

$_defaultStmtClass

string $_defaultStmtClass = 'Zend_Db_Statement_Pdo'

Default class name for a DB statement.

Details

$_defaultStmtClass
string
visibility
protected
default
Zend_Db_Statement_Pdo
final
false
static
false

Methods

_beginTransaction

_beginTransaction( ) :

Begin a transaction.

Details
visibility
protected
final
false
static
false

_commit

_commit( ) :

Commit a transaction.

Details
visibility
protected
final
false
static
false

_connect

_connect( ) : void

Creates a PDO object and connects to the database.

Details
visibility
protected
final
false
static
false
throws

_dsn

_dsn( ) : string

Creates a PDO DSN for the adapter from $this->_config settings.

Output
string
Details
visibility
protected
final
false
static
false

_quote

_quote( string $value ) : string

Quote a raw string.

Arguments
$value
string
Raw string
Output
string
Quoted string
Details
visibility
protected
final
false
static
false

_rollBack

_rollBack( ) :

Roll-back a transaction.

Details
visibility
protected
final
false
static
false

closeConnection

closeConnection( ) : void

Force the connection to close.

Details
visibility
public
final
false
static
false

exec

exec( mixed $sql ) : integer

Executes an SQL statement and return the number of affected rows

Arguments
$sql
mixed
The SQL statement with placeholders. May be a string or Zend_Db_Select.
Output
integer
Number of rows that were modified or deleted by the SQL statement
Details
visibility
public
final
false
static
false

getServerVersion

getServerVersion( ) : string

Retrieve server version in PHP style

Output
string
Details
visibility
public
final
false
static
false

isConnected

isConnected( ) : boolean

Test if a connection is active

Output
boolean
Details
visibility
public
final
false
static
false

lastInsertId

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.

Arguments
$tableName
string
OPTIONAL Name of table.
$primaryKey
string
OPTIONAL Name of primary key column.
Output
string
Details
visibility
public
final
false
static
false

prepare

prepare( string $sql ) : PDOStatement

Prepares an SQL statement.

Arguments
$sql
string
The SQL statement with placeholders.
Output
PDOStatement
Details
visibility
public
final
false
static
false

query

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 ':'

Arguments
$sql
stringZend_Db_Select
The SQL statement with placeholders.
$bind
array
An array of data to bind to the placeholders.
Details
visibility
public
final
false
static
false
throws
To re-throw PDOException.

setFetchMode

setFetchMode( int $mode ) : void

Set the PDO fetch mode.

Arguments
$mode
int
A PDO fetch mode.
Details
visibility
public
final
false
static
false
throws
todo
Support FETCH_CLASS and FETCH_INTO.

supportsParameters

supportsParameters( string $type ) : bool

Check if the adapter supports real SQL parameters.

Arguments
$type
string
'positional' or 'named'
Output
bool
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.