Public Member Functions | Protected Member Functions | Protected Attributes

Zend_Db_Adapter_Pdo_Abstract Class Reference

Inheritance diagram for Zend_Db_Adapter_Pdo_Abstract:
Zend_Db_Adapter_Abstract Zend_Db_Adapter_Pdo_Ibm Zend_Db_Adapter_Pdo_Mssql Zend_Db_Adapter_Pdo_Mysql Zend_Db_Adapter_Pdo_Oci Zend_Db_Adapter_Pdo_Pgsql Zend_Db_Adapter_Pdo_Sqlite

Public Member Functions

 isConnected ()
 closeConnection ()
 prepare ($sql)
 lastInsertId ($tableName=null, $primaryKey=null)
 query ($sql, $bind=array())
 exec ($sql)
 setFetchMode ($mode)
 supportsParameters ($type)
 getServerVersion ()

Protected Member Functions

 _dsn ()
 _connect ()
 _quote ($value)
 _beginTransaction ()
 _commit ()
 _rollBack ()

Protected Attributes

 $_defaultStmtClass = 'Zend_Db_Statement_Pdo'

Detailed Description

Definition at line 45 of file Abstract.php.


Member Function Documentation

_beginTransaction (  ) [protected]

Begin a transaction.

Reimplemented from Zend_Db_Adapter_Abstract.

Reimplemented in Zend_Db_Adapter_Pdo_Mssql.

Definition at line 302 of file Abstract.php.

_commit (  ) [protected]

Commit a transaction.

Reimplemented from Zend_Db_Adapter_Abstract.

Reimplemented in Zend_Db_Adapter_Pdo_Mssql.

Definition at line 311 of file Abstract.php.

_connect (  ) [protected]
_dsn (  ) [protected]

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

Returns:
string

Reimplemented in Zend_Db_Adapter_Pdo_Ibm, Zend_Db_Adapter_Pdo_Mssql, Zend_Db_Adapter_Pdo_Oci, and Zend_Db_Adapter_Pdo_Sqlite.

Definition at line 60 of file Abstract.php.

_quote ( value ) [protected]

Quote a raw string.

Parameters:
string$valueRaw string
Returns:
string Quoted string

Reimplemented from Zend_Db_Adapter_Abstract.

Reimplemented in Zend_Db_Adapter_Pdo_Oci.

Definition at line 290 of file Abstract.php.

_rollBack (  ) [protected]

Roll-back a transaction.

Reimplemented from Zend_Db_Adapter_Abstract.

Reimplemented in Zend_Db_Adapter_Pdo_Mssql.

Definition at line 320 of file Abstract.php.

closeConnection (  )

Force the connection to close.

Returns:
void

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 164 of file Abstract.php.

exec ( sql )

Executes an SQL statement and return the number of affected rows

Parameters:
mixed$sqlThe SQL statement with placeholders. May be a string or Zend_Db_Select.
Returns:
integer Number of rows that were modified or deleted by the SQL statement

See also:
Zend_Db_Adapter_Exception
Zend_Db_Adapter_Exception

Definition at line 256 of file Abstract.php.

getServerVersion (  )

Retrieve server version in PHP style

Returns:
string

Reimplemented from Zend_Db_Adapter_Abstract.

Reimplemented in Zend_Db_Adapter_Pdo_Ibm, and Zend_Db_Adapter_Pdo_Mssql.

Definition at line 384 of file Abstract.php.

isConnected (  )

Test if a connection is active

Returns:
boolean

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 154 of file Abstract.php.

lastInsertId ( tableName = null,
primaryKey = null 
)

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.

Parameters:
string$tableNameOPTIONAL Name of table.
string$primaryKeyOPTIONAL Name of primary key column.
Returns:
string

Reimplemented from Zend_Db_Adapter_Abstract.

Reimplemented in Zend_Db_Adapter_Pdo_Ibm, Zend_Db_Adapter_Pdo_Mssql, Zend_Db_Adapter_Pdo_Oci, and Zend_Db_Adapter_Pdo_Pgsql.

Definition at line 206 of file Abstract.php.

prepare ( sql )

Prepares an SQL statement.

Parameters:
string$sqlThe SQL statement with placeholders.
array$bindAn array of data to bind to the placeholders.
Returns:
PDOStatement

Reimplemented from Zend_Db_Adapter_Abstract.

Reimplemented in Zend_Db_Adapter_Pdo_Ibm.

Definition at line 176 of file Abstract.php.

query ( sql,
bind = array() 
)

Special handling for PDO query(). All bind parameter names must begin with ':'

Parameters:
string | Zend_Db_Select$sqlThe SQL statement with placeholders.
array$bindAn array of data to bind to the placeholders.
Returns:
Zend_Db_Statement_Pdo
Exceptions:
Zend_Db_Adapter_ExceptionTo re-throw PDOException.

See also:
Zend_Db_Statement_Exception

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 221 of file Abstract.php.

setFetchMode ( mode )

Set the PDO fetch mode.

Todo:
Support FETCH_CLASS and FETCH_INTO.
Parameters:
int$modeA PDO fetch mode.
Returns:
void
Exceptions:
Zend_Db_Adapter_Exception

See also:
Zend_Db_Adapter_Exception
Zend_Db_Adapter_Exception

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 334 of file Abstract.php.

supportsParameters ( type )

Check if the adapter supports real SQL parameters.

Parameters:
string$type'positional' or 'named'
Returns:
bool

Reimplemented from Zend_Db_Adapter_Abstract.

Definition at line 369 of file Abstract.php.


The documentation for this class was generated from the following file: