Db/Adapter/Db2.php

Show: inherited
Table of Contents

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 [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Db  
Subpackage
Adapter  
Version
$Id: Db2.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Db_Adapter_Db2

Package: Zend\Db

Class for connecting to SQL databases and performing common operations.

Parent(s)
\Zend_Db_Adapter_Abstract
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotectedbool $_allowSerialization = true
inherited

Weither or not that object can get serialized

Inherited from: \Zend_Db_Adapter_Abstract::$$_allowSerialization
Default valuetrueDetails
Type
bool
Inherited_from
\Zend_Db_Adapter_Abstract::$$_allowSerialization  
Propertyprotectedbool $_autoQuoteIdentifiers = true
inherited

Specifies whether the adapter automatically quotes identifiers.

Inherited from: \Zend_Db_Adapter_Abstract::$$_autoQuoteIdentifiers

If true, most SQL generated by Zend_Db classes applies identifier quoting automatically. If false, developer must quote identifiers themselves by calling quoteIdentifier().

Default valuetrueDetails
Type
bool
Inherited_from
\Zend_Db_Adapter_Abstract::$$_autoQuoteIdentifiers  
Propertyprotectedbool $_autoReconnectOnUnserialize = false
inherited

Weither or not the database should be reconnected to that adapter when waking up

Inherited from: \Zend_Db_Adapter_Abstract::$$_autoReconnectOnUnserialize
Default valuefalseDetails
Type
bool
Inherited_from
\Zend_Db_Adapter_Abstract::$$_autoReconnectOnUnserialize  
Propertyprotectedinteger $_caseFolding = \Zend_Db::CASE_NATURAL
inherited

Specifies the case of column names retrieved in queries Options Zend_Db::CASE_NATURAL (default) Zend_Db::CASE_LOWER Zend_Db::CASE_UPPER

Inherited from: \Zend_Db_Adapter_Abstract::$$_caseFolding
Default value\Zend_Db::CASE_NATURALDetails
Type
integer
Inherited_from
\Zend_Db_Adapter_Abstract::$$_caseFolding  
Propertyprotectedarray $_config = array('dbname' => null, 'username' => null, 'password' => null, 'host' => 'localhost', 'port' => '50000', 'protocol' => 'TCPIP', 'persistent' => false, 'os' => null, 'schema' => null)

User-provided configuration.

Basic keys are:

username => (string) Connect to the database as this username. password => (string) Password associated with the username. host => (string) What host to connect to (default 127.0.0.1) dbname => (string) The name of the database to user protocol => (string) Protocol to use, defaults to "TCPIP" port => (integer) Port number to use for TCP/IP if protocol is "TCPIP" persistent => (boolean) Set TRUE to use a persistent connection (db2_pconnect) os => (string) This should be set to 'i5' if the db is on an os400/i5 schema => (string) The default schema the connection should use

Default valuearray('dbname' => null, 'username' => null, 'password' => null, 'host' => 'localhost', 'port' => '50000', 'protocol' => 'TCPIP', 'persistent' => false, 'os' => null, 'schema' => null)Details
Type
array
Propertyprotectedobject|resource|null $_connection = null
inherited

Database connection

Inherited from: \Zend_Db_Adapter_Abstract::$$_connection
Default valuenullDetails
Type
object | resource | null
Inherited_from
\Zend_Db_Adapter_Abstract::$$_connection  
Propertyprotectedstring $_defaultProfilerClass = 'Zend_Db_Profiler'
inherited

Default class name for the profiler object.

Inherited from: \Zend_Db_Adapter_Abstract::$$_defaultProfilerClass
Default value'Zend_Db_Profiler'Details
Type
string
Inherited_from
\Zend_Db_Adapter_Abstract::$$_defaultProfilerClass  
Propertyprotectedstring $_defaultStmtClass = 'Zend_Db_Statement_Db2'

Default class name for a DB statement.

Default value'Zend_Db_Statement_Db2'Details
Type
string
Propertyprotectedint $_execute_mode = DB2_AUTOCOMMIT_ON

Execution mode

<p>execution flag (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)</p>
Default valueDB2_AUTOCOMMIT_ONDetails
Type
int
Propertyprotectedinteger $_fetchMode = \Zend_Db::FETCH_ASSOC
inherited

Fetch mode

Inherited from: \Zend_Db_Adapter_Abstract::$$_fetchMode
Default value\Zend_Db::FETCH_ASSOCDetails
Type
integer
Inherited_from
\Zend_Db_Adapter_Abstract::$$_fetchMode  
Propertyprotected$_isI5 = false
Default valuefalseDetails
Type
n/a
Propertyprotectedarray $_numericDataTypes = array(\Zend_Db::INT_TYPE => \Zend_Db::INT_TYPE, \Zend_Db::BIGINT_TYPE => \Zend_Db::BIGINT_TYPE, \Zend_Db::FLOAT_TYPE => \Zend_Db::FLOAT_TYPE, 'INTEGER' => \Zend_Db::INT_TYPE, 'SMALLINT' => \Zend_Db::INT_TYPE, 'BIGINT' => \Zend_Db::BIGINT_TYPE, 'DECIMAL' => \Zend_Db::FLOAT_TYPE, 'NUMERIC' => \Zend_Db::FLOAT_TYPE)

Keys are UPPERCASE SQL datatypes or the constants Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.

<p>Associative array of datatypes to values 0, 1, or 2.</p>

Values are: 0 = 32-bit integer 1 = 64-bit integer 2 = float or decimal

Default valuearray(\Zend_Db::INT_TYPE => \Zend_Db::INT_TYPE, \Zend_Db::BIGINT_TYPE => \Zend_Db::BIGINT_TYPE, \Zend_Db::FLOAT_TYPE => \Zend_Db::FLOAT_TYPE, 'INTEGER' => \Zend_Db::INT_TYPE, 'SMALLINT' => \Zend_Db::INT_TYPE, 'BIGINT' => \Zend_Db::BIGINT_TYPE, 'DECIMAL' => \Zend_Db::FLOAT_TYPE, 'NUMERIC' => \Zend_Db::FLOAT_TYPE)Details
Type
array
Propertyprotected\Zend_Db_Profiler $_profiler =
inherited

Query profiler object, of type Zend_Db_Profiler or a subclass of that.

Inherited from: \Zend_Db_Adapter_Abstract::$$_profiler

Methods

methodpublic__construct(array | \Zend_Config $config) : void
inherited

Constructor.

Inherited from: \Zend_Db_Adapter_Abstract::__construct()

$config is an array of key/value pairs or an instance of Zend_Config containing configuration options. These options are common to most adapters:

dbname => (string) The name of the database to user username => (string) Connect to the database as this username. password => (string) Password associated with the username. host => (string) What host to connect to, defaults to localhost

Some options are used on a case-by-case basis by adapters:

port => (string) The port of the database persistent => (boolean) Whether to use a persistent connection or not, defaults to false protocol => (string) The network protocol, defaults to TCPIP caseFolding => (int) style of case-alteration used for identifiers socket => (string) The socket or named pipe that should be used

Parameters
Name Type Description
$config array | \Zend_Config

An array or instance of Zend_Config having configuration data

Throws
Exception Description
\Zend_Db_Adapter_Exception
methodpublic__sleep() : array
inherited

called when object is getting serialized This disconnects the DB object that cant be serialized

Inherited from: \Zend_Db_Adapter_Abstract::__sleep()
Returns
Type Description
array
Throws
Exception Description
\Zend_Db_Adapter_Exception
methodpublic__wakeup() : void
inherited

called when object is getting unserialized

Inherited from: \Zend_Db_Adapter_Abstract::__wakeup()
methodprotected_beginTransaction() : void

Begin a transaction.

methodprotected_checkRequiredOptions(array $config) : void
inherited

Check for config options that are mandatory.

Inherited from: \Zend_Db_Adapter_Abstract::_checkRequiredOptions()

Throw exceptions if any are missing.

Parameters
Name Type Description
$config array
Throws
Exception Description
\Zend_Db_Adapter_Exception
methodprotected_commit() : void

Commit a transaction.

methodprotected_connect() : void

Creates a connection resource.

methodprotected_determineI5() : void

Check the connection parameters according to verify type of used OS

@return void

methodpublic_getExecuteMode() : int

Gets the execution mode

Returns
Type Description
int the execution mode (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
methodprotected_i5LastInsertId( $objectName = null,  $idType = null) : void

Parameters
Name Type Description
$objectName
$idType
methodprotected_i5listTables( $schema = null) : array

Db2 On I5 specific method

Returns a list of the tables in the database . Used only for DB2/400.

Parameters
Name Type Description
$schema
Returns
Type Description
array
methodprotected_quote(string $value) : string

Quote a raw string.

Parameters
Name Type Description
$value string

Raw string

Returns
Type Description
string Quoted string
methodprotected_quoteIdentifier(string $value, boolean $auto = false) : string
inherited

Quote an identifier.

Inherited from: \Zend_Db_Adapter_Abstract::_quoteIdentifier()
Parameters
Name Type Description
$value string

The identifier or expression.

$auto boolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
Type Description
string The quoted identifier and alias.
methodprotected_quoteIdentifierAs(string | array | \Zend_Db_Expr $ident, string $alias = null, boolean $auto = false, string $as = ' AS ') : string
inherited

Quote an identifier and an optional alias.

Inherited from: \Zend_Db_Adapter_Abstract::_quoteIdentifierAs()
Parameters
Name Type Description
$ident string | array | \Zend_Db_Expr

The identifier or expression.

$alias string

An optional alias.

$auto boolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

$as string

The string to add between the identifier/expression and the alias.

Returns
Type Description
string The quoted identifier and alias.
methodprotected_rollBack() : void

Rollback a transaction.

methodpublic_setExecuteMode(integer $mode) : void

Parameters
Name Type Description
$mode integer
methodprotected_whereExpr(mixed $where) : string
inherited

Convert an array, string, or Zend_Db_Expr object into a string to put in a WHERE clause.

Inherited from: \Zend_Db_Adapter_Abstract::_whereExpr()
Parameters
Name Type Description
$where mixed
Returns
Type Description
string
methodpublicbeginTransaction() : \Zend_Db_Adapter_Abstract
inherited

Leave autocommit mode and begin a transaction.

Inherited from: \Zend_Db_Adapter_Abstract::beginTransaction()
Returns
Type Description
\Zend_Db_Adapter_Abstract
methodpubliccloseConnection() : void

Force the connection to close.

methodpubliccommit() : \Zend_Db_Adapter_Abstract
inherited

Commit a transaction and return to autocommit mode.

Inherited from: \Zend_Db_Adapter_Abstract::commit()
Returns
Type Description
\Zend_Db_Adapter_Abstract
methodpublicdelete(mixed $table, mixed $where = '') : int
inherited

Deletes table rows based on a WHERE clause.

Inherited from: \Zend_Db_Adapter_Abstract::delete()
Parameters
Name Type Description
$table mixed

The table to update.

$where mixed

DELETE WHERE clause(s).

Returns
Type Description
int The number of affected rows.
methodpublicdescribeTable(string $tableName, string $schemaName = null) : array

Returns the column descriptions for a table.

The return value is an associative array keyed by the column name, as returned by the RDBMS.

The value of each array element is an associative array with the following keys:

SCHEMA_NAME => string; name of database or schema TABLE_NAME => string; COLUMN_NAME => string; column name COLUMN_POSITION => number; ordinal position of column in table DATA_TYPE => string; SQL datatype name of column DEFAULT => string; default expression of column, null if none NULLABLE => boolean; true if column can have nulls LENGTH => number; length of CHAR/VARCHAR SCALE => number; scale of NUMERIC/DECIMAL PRECISION => number; precision of NUMERIC/DECIMAL UNSIGNED => boolean; unsigned property of an integer type DB2 not supports UNSIGNED integer. PRIMARY => boolean; true if column is part of the primary key PRIMARY_POSITION => integer; position of column in primary key IDENTITY => integer; true if column is auto-generated with unique values

Parameters
Name Type Description
$tableName string
$schemaName string

OPTIONAL

Returns
Type Description
array
methodpublicfetchAll(string | \Zend_Db_Select $sql, mixed $bind = array(), mixed $fetchMode = null) : array
inherited

Fetches all SQL result rows as a sequential array.

Inherited from: \Zend_Db_Adapter_Abstract::fetchAll()

Uses the current fetchMode for the adapter.

Parameters
Name Type Description
$sql string | \Zend_Db_Select

An SQL SELECT statement.

$bind mixed

Data to bind into SELECT placeholders.

$fetchMode mixed

Override current fetch mode.

Returns
Type Description
array
methodpublicfetchAssoc(string | \Zend_Db_Select $sql, mixed $bind = array()) : array
inherited

Fetches all SQL result rows as an associative array.

Inherited from: \Zend_Db_Adapter_Abstract::fetchAssoc()

The first column is the key, the entire row array is the value. You should construct the query to be sure that the first column contains unique values, or else rows with duplicate values in the first column will overwrite previous data.

Parameters
Name Type Description
$sql string | \Zend_Db_Select

An SQL SELECT statement.

$bind mixed

Data to bind into SELECT placeholders.

Returns
Type Description
array
methodpublicfetchCol(string | \Zend_Db_Select $sql, mixed $bind = array()) : array
inherited

Fetches the first column of all SQL result rows as an array.

Inherited from: \Zend_Db_Adapter_Abstract::fetchCol()
Parameters
Name Type Description
$sql string | \Zend_Db_Select

An SQL SELECT statement.

$bind mixed

Data to bind into SELECT placeholders.

Returns
Type Description
array
methodpublicfetchOne(string | \Zend_Db_Select $sql, mixed $bind = array()) : string
inherited

Fetches the first column of the first row of the SQL result.

Inherited from: \Zend_Db_Adapter_Abstract::fetchOne()
Parameters
Name Type Description
$sql string | \Zend_Db_Select

An SQL SELECT statement.

$bind mixed

Data to bind into SELECT placeholders.

Returns
Type Description
string
methodpublicfetchPairs(string | \Zend_Db_Select $sql, mixed $bind = array()) : array
inherited

Fetches all SQL result rows as an array of key-value pairs.

Inherited from: \Zend_Db_Adapter_Abstract::fetchPairs()

The first column is the key, the second column is the value.

Parameters
Name Type Description
$sql string | \Zend_Db_Select

An SQL SELECT statement.

$bind mixed

Data to bind into SELECT placeholders.

Returns
Type Description
array
methodpublicfetchRow(string | \Zend_Db_Select $sql, mixed $bind = array(), mixed $fetchMode = null) : mixed
inherited

Fetches the first row of the SQL result.

Inherited from: \Zend_Db_Adapter_Abstract::fetchRow()

Uses the current fetchMode for the adapter.

Parameters
Name Type Description
$sql string | \Zend_Db_Select

An SQL SELECT statement.

$bind mixed

Data to bind into SELECT placeholders.

$fetchMode mixed

Override current fetch mode.

Returns
Type Description
mixed Array, object, or scalar depending on fetch mode.
methodpublicfoldCase(string $key) : string
inherited

Helper method to change the case of the strings used when returning result sets in FETCH_ASSOC and FETCH_BOTH modes.

Inherited from: \Zend_Db_Adapter_Abstract::foldCase()

This is not intended to be used by application code, but the method must be public so the Statement class can invoke it.

Parameters
Name Type Description
$key string
Returns
Type Description
string
methodpublicgetConfig() : array
inherited

Returns the configuration variables in this adapter.

Inherited from: \Zend_Db_Adapter_Abstract::getConfig()
Returns
Type Description
array
methodpublicgetConnection() : object | resource | null
inherited

Returns the underlying database connection object or resource.

Inherited from: \Zend_Db_Adapter_Abstract::getConnection()

If not presently connected, this initiates the connection.

Returns
Type Description
object | resource | null
methodpublicgetFetchMode() : int
inherited

Get the fetch mode.

Inherited from: \Zend_Db_Adapter_Abstract::getFetchMode()
Returns
Type Description
int
methodpublicgetProfiler() : \Zend_Db_Profiler
inherited

Returns the profiler for this adapter.

Inherited from: \Zend_Db_Adapter_Abstract::getProfiler()
Returns
Type Description
\Zend_Db_Profiler
methodpublicgetQuoteIdentifierSymbol() : string

Returns the symbol the adapter uses for delimited identifiers.

Returns
Type Description
string
methodpublicgetServerVersion() : string

Retrieve server version in PHP style

Returns
Type Description
string
methodpublicgetStatementClass() : string
inherited

Get the default statement class.

Inherited from: \Zend_Db_Adapter_Abstract::getStatementClass()
Returns
Type Description
string
methodpublicinsert(mixed $table, array $bind) : int
inherited

Inserts a table row with specified data.

Inherited from: \Zend_Db_Adapter_Abstract::insert()
Parameters
Name Type Description
$table mixed

The table to insert data into.

$bind array

Column-value pairs.

Returns
Type Description
int The number of affected rows.
Throws
Exception Description
\Zend_Db_Adapter_Exception
methodpublicisConnected() : boolean

Test if a connection is active

Returns
Type Description
boolean
methodpublicisI5() : bool

Return whether or not this is running on i5

Returns
Type Description
bool
methodpubliclastInsertId(string $tableName = null, string $primaryKey = null, string $idType = 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.

The IDENTITY_VAL_LOCAL() function gives the last generated identity value in the current process, even if it was for a GENERATED column.

Parameters
Name Type Description
$tableName string

OPTIONAL

$primaryKey string

OPTIONAL

$idType string

OPTIONAL used for i5 platform to define sequence/idenity unique value

Returns
Type Description
string
methodpubliclastSequenceId(string $sequenceName) : string

Return the most recent value from the specified sequence in the database.

This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.

Parameters
Name Type Description
$sequenceName string
Returns
Type Description
string
methodpubliclimit(string $sql, integer $count, integer $offset = 0) : string

Adds an adapter-specific LIMIT clause to the SELECT statement.

Parameters
Name Type Description
$sql string
$count integer
$offset integer

OPTIONAL

Returns
Type Description
string
methodpubliclistTables(string $schema = null) : array

Returns a list of the tables in the database.

Parameters
Name Type Description
$schema string

OPTIONAL

Returns
Type Description
array
methodpublicnextSequenceId(string $sequenceName) : string

Generate a new value from the specified sequence in the database, and return it.

This is supported only on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.

Parameters
Name Type Description
$sequenceName string
Returns
Type Description
string
methodpublicprepare(string $sql) : \Zend_Db_Statement_Db2

Returns an SQL statement for preparation.

Parameters
Name Type Description
$sql string

The SQL statement with placeholders.

Returns
Type Description
\Zend_Db_Statement_Db2
methodpublicquery(mixed $sql, mixed $bind = array()) : \Zend_Db_Statement_Interface
inherited

Prepares and executes an SQL statement with bound data.

Inherited from: \Zend_Db_Adapter_Abstract::query()
Parameters
Name Type Description
$sql mixed

The SQL statement with placeholders. May be a string or Zend_Db_Select.

$bind mixed

An array of data to bind to the placeholders.

Returns
Type Description
\Zend_Db_Statement_Interface
methodpublicquote(mixed $value, mixed $type = null) : mixed
inherited

Safely quotes a value for an SQL statement.

Inherited from: \Zend_Db_Adapter_Abstract::quote()

If an array is passed as the value, the array values are quoted and then returned as a comma-separated string.

Parameters
Name Type Description
$value mixed

The value to quote.

$type mixed

OPTIONAL the SQL datatype name, or constant, or null.

Returns
Type Description
mixed An SQL-safe quoted value (or string of separated values).
methodpublicquoteColumnAs(string | array | \Zend_Db_Expr $ident, string $alias, boolean $auto = false) : string
inherited

Quote a column identifier and alias.

Inherited from: \Zend_Db_Adapter_Abstract::quoteColumnAs()
Parameters
Name Type Description
$ident string | array | \Zend_Db_Expr

The identifier or expression.

$alias string

An alias for the column.

$auto boolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
Type Description
string The quoted identifier and alias.
methodpublicquoteIdentifier(string | array | \Zend_Db_Expr $ident, boolean $auto = false) : string
inherited

Quotes an identifier.

Inherited from: \Zend_Db_Adapter_Abstract::quoteIdentifier()

Accepts a string representing a qualified indentifier. For Example:

$adapter->quoteIdentifier('myschema.mytable')

Returns: "myschema"."mytable"

Or, an array of one or more identifiers that may form a qualified identifier:

$adapter->quoteIdentifier(array('myschema','my.table'))

Returns: "myschema"."my.table"

The actual quote character surrounding the identifiers may vary depending on the adapter.

Parameters
Name Type Description
$ident string | array | \Zend_Db_Expr

The identifier.

$auto boolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
Type Description
string The quoted identifier.
methodpublicquoteInto(string $text, mixed $value, string $type = null, integer $count = null) : string
inherited

Quotes a value and places into a piece of text at a placeholder.

Inherited from: \Zend_Db_Adapter_Abstract::quoteInto()

The placeholder is a question-mark; all placeholders will be replaced with the quoted value. For example:

$text = "WHERE date < ?";
$date = "2005-01-02";
$safe = $sql->quoteInto($text, $date);
// $safe = "WHERE date < '2005-01-02'"
Parameters
Name Type Description
$text string

The text with a placeholder.

$value mixed

The value to quote.

$type string

OPTIONAL SQL datatype

$count integer

OPTIONAL count of placeholders to replace

Returns
Type Description
string An SQL-safe quoted value placed into the original text.
methodpublicquoteTableAs(string | array | \Zend_Db_Expr $ident, string $alias = null, boolean $auto = false) : string
inherited

Quote a table identifier and alias.

Inherited from: \Zend_Db_Adapter_Abstract::quoteTableAs()
Parameters
Name Type Description
$ident string | array | \Zend_Db_Expr

The identifier or expression.

$alias string

An alias for the table.

$auto boolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
Type Description
string The quoted identifier and alias.
methodpublicrollBack() : \Zend_Db_Adapter_Abstract
inherited

Roll back a transaction and return to autocommit mode.

Inherited from: \Zend_Db_Adapter_Abstract::rollBack()
Returns
Type Description
\Zend_Db_Adapter_Abstract
methodpublicselect() : \Zend_Db_Select
inherited

Creates and returns a new Zend_Db_Select object for this adapter.

Inherited from: \Zend_Db_Adapter_Abstract::select()
Returns
Type Description
\Zend_Db_Select
methodpublicsetFetchMode(integer $mode) : void

Set the fetch mode.

Parameters
Name Type Description
$mode integer
Throws
Exception Description
\Zend_Db_Adapter_Db2_Exception
methodpublicsetProfiler(\Zend_Db_Profiler | \Zend_Config | array | boolean $profiler) : \Zend_Db_Adapter_Abstract
inherited

Set the adapter's profiler object.

Inherited from: \Zend_Db_Adapter_Abstract::setProfiler()

The argument may be a boolean, an associative array, an instance of Zend_Db_Profiler, or an instance of Zend_Config.

A boolean argument sets the profiler to enabled if true, or disabled if false. The profiler class is the adapter's default profiler class, Zend_Db_Profiler.

An instance of Zend_Db_Profiler sets the adapter's instance to that object. The profiler is enabled and disabled separately.

An associative array argument may contain any of the keys 'enabled', 'class', and 'instance'. The 'enabled' and 'instance' keys correspond to the boolean and object types documented above. The 'class' key is used to name a class to use for a custom profiler. The class must be Zend_Db_Profiler or a subclass. The class is instantiated with no constructor arguments. The 'class' option is ignored when the 'instance' option is supplied.

An object of type Zend_Config may contain the properties 'enabled', 'class', and 'instance', just as if an associative array had been passed instead.

Parameters
Name Type Description
$profiler \Zend_Db_Profiler | \Zend_Config | array | boolean
Returns
Type Description
\Zend_Db_Adapter_Abstract Provides a fluent interface
Throws
Exception Description
\Zend_Db_Profiler_Exception if the object instance or class specified is not Zend_Db_Profiler or an extension of that class.
methodpublicsetStatementClass( $class) : \Zend_Db_Adapter_Abstract
inherited

Set the default statement class.

Inherited from: \Zend_Db_Adapter_Abstract::setStatementClass()
Parameters
Name Type Description
$class
Returns
Type Description
\Zend_Db_Adapter_Abstract Fluent interface
methodpublicsupportsParameters(string $type) : bool

Check if the adapter supports real SQL parameters.

Parameters
Name Type Description
$type string

'positional' or 'named'

Returns
Type Description
bool
methodpublicupdate(mixed $table, array $bind, mixed $where = '') : int
inherited

Updates table rows with specified data based on a WHERE clause.

Inherited from: \Zend_Db_Adapter_Abstract::update()
Parameters
Name Type Description
$table mixed

The table to update.

$bind array

Column-value pairs.

$where mixed

UPDATE WHERE clause(s).

Returns
Type Description
int The number of affected rows.
Throws
Exception Description
\Zend_Db_Adapter_Exception
Documentation was generated by phpDocumentor 2.0.0a8.