Db/Adapter/Pdo/Mssql.php

Show: PublicProtectedPrivateinherited
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 license@zend.com 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: Mssql.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Db_Adapter_Pdo_Mssql

Package: Zend\Db\Adapter
Class for connecting to Microsoft SQL Server databases and performing common operations.
Parent(s)
\Zend_Db_Adapter_Pdo_Abstract < \Zend_Db_Adapter_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedbool $_allowSerialization = true
inherited
Weither or not that object can get serialized
Inherited from: \Zend_Db_Adapter_Abstract::$$_allowSerialization\Zend_Db_Adapter_Pdo_Abstract::$$_allowSerialization
Default valuetrueDetails
Type
bool
Inherited_from
\Zend_Db_Adapter_Abstract::$$_allowSerialization  
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_allowSerialization  
>VPropertyprotectedbool $_autoQuoteIdentifiers = true
inherited
Specifies whether the adapter automatically quotes identifiers.
Inherited from: \Zend_Db_Adapter_Abstract::$$_autoQuoteIdentifiers\Zend_Db_Adapter_Pdo_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  
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_autoQuoteIdentifiers  
>VPropertyprotectedbool $_autoReconnectOnUnserialize = false
inherited
Weither or not the database should be reconnected to that adapter when waking up
Inherited from: \Zend_Db_Adapter_Abstract::$$_autoReconnectOnUnserialize\Zend_Db_Adapter_Pdo_Abstract::$$_autoReconnectOnUnserialize
>VPropertyprotectedinteger $_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\Zend_Db_Adapter_Pdo_Abstract::$$_caseFolding
Default value\Zend_Db::CASE_NATURALDetails
Type
integer
Inherited_from
\Zend_Db_Adapter_Abstract::$$_caseFolding  
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_caseFolding  
>VPropertyprotectedarray $_config = array()
inherited
User-provided configuration
Inherited from: \Zend_Db_Adapter_Abstract::$$_config\Zend_Db_Adapter_Pdo_Abstract::$$_config
Default valuearray()Details
Type
array
Inherited_from
\Zend_Db_Adapter_Abstract::$$_config  
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_config  
>VPropertyprotectedobject|resource|null $_connection = null
Default valuenullDetails
Type
object | resource | null
Inherited_from
\Zend_Db_Adapter_Abstract::$$_connection  
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_connection  
>VPropertyprotectedstring $_defaultProfilerClass = 'Zend_Db_Profiler'
Default value'Zend_Db_Profiler'Details
Type
string
Inherited_from
\Zend_Db_Adapter_Abstract::$$_defaultProfilerClass  
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_defaultProfilerClass  
>VPropertyprotectedstring $_defaultStmtClass = 'Zend_Db_Statement_Pdo'
inherited
Default class name for a DB statement.
Inherited from: \Zend_Db_Adapter_Pdo_Abstract::$$_defaultStmtClass
Default value'Zend_Db_Statement_Pdo'Details
Type
string
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_defaultStmtClass  
>VPropertyprotectedinteger $_fetchMode = \Zend_Db::FETCH_ASSOC
Default value\Zend_Db::FETCH_ASSOCDetails
Type
integer
Inherited_from
\Zend_Db_Adapter_Abstract::$$_fetchMode  
Inherited_from
\Zend_Db_Adapter_Pdo_Abstract::$$_fetchMode  
>VPropertyprotectedarray $_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, 'INT' => \Zend_Db::INT_TYPE, 'SMALLINT' => \Zend_Db::INT_TYPE, 'TINYINT' => \Zend_Db::INT_TYPE, 'BIGINT' => \Zend_Db::BIGINT_TYPE, 'DECIMAL' => \Zend_Db::FLOAT_TYPE, 'FLOAT' => \Zend_Db::FLOAT_TYPE, 'MONEY' => \Zend_Db::FLOAT_TYPE, 'NUMERIC' => \Zend_Db::FLOAT_TYPE, 'REAL' => \Zend_Db::FLOAT_TYPE, 'SMALLMONEY' => \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.

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, 'INT' => \Zend_Db::INT_TYPE, 'SMALLINT' => \Zend_Db::INT_TYPE, 'TINYINT' => \Zend_Db::INT_TYPE, 'BIGINT' => \Zend_Db::BIGINT_TYPE, 'DECIMAL' => \Zend_Db::FLOAT_TYPE, 'FLOAT' => \Zend_Db::FLOAT_TYPE, 'MONEY' => \Zend_Db::FLOAT_TYPE, 'NUMERIC' => \Zend_Db::FLOAT_TYPE, 'REAL' => \Zend_Db::FLOAT_TYPE, 'SMALLMONEY' => \Zend_Db::FLOAT_TYPE)Details
Type
array
>VPropertyprotectedstring $_pdoType = 'mssql'
PDO type.
Default value'mssql'Details
Type
string
>VPropertyprotected\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\Zend_Db_Adapter_Pdo_Abstract::$$_profiler

Methods

methodpublic__construct(array | \Zend_Config $config) : void

$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
NameTypeDescription
$configarray | \Zend_Config

An array or instance of Zend_Config having configuration data

Throws
ExceptionDescription
\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()\Zend_Db_Adapter_Pdo_Abstract::__sleep()
Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Db_Adapter_Exception
methodpublic__wakeup() : void
inherited

called when object is getting unserialized

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

Begin a transaction.

It is necessary to override the abstract PDO transaction functions here, as the PDO driver for MSSQL does not support transactions.

methodprotected_checkRequiredOptions(array $config) : void

Throw exceptions if any are missing.

Parameters
NameTypeDescription
$configarray
Throws
ExceptionDescription
\Zend_Db_Adapter_Exception
methodprotected_commit() : void

Commit a transaction.

It is necessary to override the abstract PDO transaction functions here, as the PDO driver for MSSQL does not support transactions.

methodprotected_connect() : void

Creates a PDO object and connects to the database.

Throws
ExceptionDescription
\Zend_Db_Adapter_Exception
methodprotected_dsn() : string

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

Returns
TypeDescription
string
methodprotected_quote(string $value) : string
inherited

Quote a raw string.

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::_quote()
Parameters
NameTypeDescription
$valuestring

Raw string

Returns
TypeDescription
stringQuoted string
methodprotected_quoteIdentifier(string $value, boolean $auto = false) : string
Parameters
NameTypeDescription
$valuestring

The identifier or expression.

$autoboolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
TypeDescription
stringThe 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()\Zend_Db_Adapter_Pdo_Abstract::_quoteIdentifierAs()
Parameters
NameTypeDescription
$identstring | array | \Zend_Db_Expr

The identifier or expression.

$aliasstring

An optional alias.

$autoboolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

$asstring

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

Returns
TypeDescription
stringThe quoted identifier and alias.
methodprotected_rollBack() : void

Roll-back a transaction.

It is necessary to override the abstract PDO transaction functions here, as the PDO driver for MSSQL does not support transactions.

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()\Zend_Db_Adapter_Pdo_Abstract::_whereExpr()
Parameters
NameTypeDescription
$wheremixed
Returns
TypeDescription
string
methodpublicbeginTransaction() : \Zend_Db_Adapter_Abstract
inherited

Leave autocommit mode and begin a transaction.

Inherited from: \Zend_Db_Adapter_Abstract::beginTransaction()\Zend_Db_Adapter_Pdo_Abstract::beginTransaction()
Returns
TypeDescription
\Zend_Db_Adapter_Abstract
methodpubliccloseConnection() : void
inherited

Force the connection to close.

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::closeConnection()
methodpubliccommit() : \Zend_Db_Adapter_Abstract
inherited

Commit a transaction and return to autocommit mode.

Inherited from: \Zend_Db_Adapter_Abstract::commit()\Zend_Db_Adapter_Pdo_Abstract::commit()
Returns
TypeDescription
\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()\Zend_Db_Adapter_Pdo_Abstract::delete()
Parameters
NameTypeDescription
$tablemixed

The table to update.

$wheremixed

DELETE WHERE clause(s).

Returns
TypeDescription
intThe 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 PRIMARY => boolean; true if column is part of the primary key PRIMARY_POSITION => integer; position of column in primary key PRIMARY_AUTO => integer; position of auto-generated column in primary key

Parameters
NameTypeDescription
$tableNamestring
$schemaNamestring

OPTIONAL

Returns
TypeDescription
array
Details
Todo
Discover column primary key position.  
Todo
Discover integer unsigned property.  
methodpublicexec(mixed $sql) : integer
inherited

Executes an SQL statement and return the number of affected rows

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::exec()
Parameters
NameTypeDescription
$sqlmixed

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

Returns
TypeDescription
integerNumber of rows that were modified or deleted by the SQL statement
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()\Zend_Db_Adapter_Pdo_Abstract::fetchAll()

Uses the current fetchMode for the adapter.

Parameters
NameTypeDescription
$sqlstring | \Zend_Db_Select

An SQL SELECT statement.

$bindmixed

Data to bind into SELECT placeholders.

$fetchModemixed

Override current fetch mode.

Returns
TypeDescription
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()\Zend_Db_Adapter_Pdo_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
NameTypeDescription
$sqlstring | \Zend_Db_Select

An SQL SELECT statement.

$bindmixed

Data to bind into SELECT placeholders.

Returns
TypeDescription
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()\Zend_Db_Adapter_Pdo_Abstract::fetchCol()
Parameters
NameTypeDescription
$sqlstring | \Zend_Db_Select

An SQL SELECT statement.

$bindmixed

Data to bind into SELECT placeholders.

Returns
TypeDescription
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()\Zend_Db_Adapter_Pdo_Abstract::fetchOne()
Parameters
NameTypeDescription
$sqlstring | \Zend_Db_Select

An SQL SELECT statement.

$bindmixed

Data to bind into SELECT placeholders.

Returns
TypeDescription
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()\Zend_Db_Adapter_Pdo_Abstract::fetchPairs()

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

Parameters
NameTypeDescription
$sqlstring | \Zend_Db_Select

An SQL SELECT statement.

$bindmixed

Data to bind into SELECT placeholders.

Returns
TypeDescription
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()\Zend_Db_Adapter_Pdo_Abstract::fetchRow()

Uses the current fetchMode for the adapter.

Parameters
NameTypeDescription
$sqlstring | \Zend_Db_Select

An SQL SELECT statement.

$bindmixed

Data to bind into SELECT placeholders.

$fetchModemixed

Override current fetch mode.

Returns
TypeDescription
mixedArray, 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()\Zend_Db_Adapter_Pdo_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
NameTypeDescription
$keystring
Returns
TypeDescription
string
methodpublicgetConfig() : array
inherited

Returns the configuration variables in this adapter.

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

Returns the underlying database connection object or resource.

Inherited from: \Zend_Db_Adapter_Abstract::getConnection()\Zend_Db_Adapter_Pdo_Abstract::getConnection()

If not presently connected, this initiates the connection.

Returns
TypeDescription
object | resource | null
methodpublicgetFetchMode() : int
Returns
TypeDescription
int
methodpublicgetProfiler() : \Zend_Db_Profiler
inherited

Returns the profiler for this adapter.

Inherited from: \Zend_Db_Adapter_Abstract::getProfiler()\Zend_Db_Adapter_Pdo_Abstract::getProfiler()
Returns
TypeDescription
\Zend_Db_Profiler
methodpublicgetQuoteIdentifierSymbol() : string
inherited

Returns the symbol the adapter uses for delimited identifiers.

Inherited from: \Zend_Db_Adapter_Abstract::getQuoteIdentifierSymbol()\Zend_Db_Adapter_Pdo_Abstract::getQuoteIdentifierSymbol()
Returns
TypeDescription
string
methodpublicgetServerVersion() : string

Retrieve server version in PHP style Pdo_Mssql doesn't support getAttribute(PDO::ATTR_SERVER_VERSION)

Returns
TypeDescription
string
methodpublicgetStatementClass() : string
Returns
TypeDescription
string
methodpublicinsert(mixed $table, array $bind) : int
inherited

Inserts a table row with specified data.

Inherited from: \Zend_Db_Adapter_Abstract::insert()\Zend_Db_Adapter_Pdo_Abstract::insert()
Parameters
NameTypeDescription
$tablemixed

The table to insert data into.

$bindarray

Column-value pairs.

Returns
TypeDescription
intThe number of affected rows.
Throws
ExceptionDescription
\Zend_Db_Adapter_Exception
methodpublicisConnected() : boolean
inherited

Test if a connection is active

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::isConnected()
Returns
TypeDescription
boolean
methodpubliclastInsertId(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.

Microsoft SQL Server does not support sequences, so the arguments to this method are ignored.

Parameters
NameTypeDescription
$tableNamestring

OPTIONAL Name of table.

$primaryKeystring

OPTIONAL Name of primary key column.

Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Db_Adapter_Exception
methodpubliclastSequenceId(string $sequenceName) : string
inherited

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

Inherited from: \Zend_Db_Adapter_Abstract::lastSequenceId()\Zend_Db_Adapter_Pdo_Abstract::lastSequenceId()

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

Parameters
NameTypeDescription
$sequenceNamestring
Returns
TypeDescription
string
methodpubliclimit(string $sql, integer $count, integer $offset = 0) : string

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

Parameters
NameTypeDescription
$sqlstring
$countinteger
$offsetinteger

OPTIONAL

Returns
TypeDescription
string
Throws
ExceptionDescription
\Zend_Db_Adapter_Exception
Details
Link
http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html  
methodpubliclistTables() : array

Returns a list of the tables in the database.

Returns
TypeDescription
array
methodpublicnextSequenceId(string $sequenceName) : string
inherited

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

Inherited from: \Zend_Db_Adapter_Abstract::nextSequenceId()\Zend_Db_Adapter_Pdo_Abstract::nextSequenceId()

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

Parameters
NameTypeDescription
$sequenceNamestring
Returns
TypeDescription
string
methodpublicprepare(string $sql) : \PDOStatement
inherited

Prepares an SQL statement.

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::prepare()
Parameters
NameTypeDescription
$sqlstring

The SQL statement with placeholders.

Returns
TypeDescription
\PDOStatement
methodpublicquery(string | \Zend_Db_Select $sql, array $bind = array()) : \Zend_Db_Statement_Pdo
inherited

Special handling for PDO query().

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::query()

All bind parameter names must begin with ':'

Parameters
NameTypeDescription
$sqlstring | \Zend_Db_Select

The SQL statement with placeholders.

$bindarray

An array of data to bind to the placeholders.

Returns
TypeDescription
\Zend_Db_Statement_Pdo
Throws
ExceptionDescription
\Zend_Db_Adapter_ExceptionTo re-throw PDOException.
methodpublicquote(mixed $value, mixed $type = null) : mixed
inherited

Safely quotes a value for an SQL statement.

Inherited from: \Zend_Db_Adapter_Abstract::quote()\Zend_Db_Adapter_Pdo_Abstract::quote()

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

Parameters
NameTypeDescription
$valuemixed

The value to quote.

$typemixed

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

Returns
TypeDescription
mixedAn 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()\Zend_Db_Adapter_Pdo_Abstract::quoteColumnAs()
Parameters
NameTypeDescription
$identstring | array | \Zend_Db_Expr

The identifier or expression.

$aliasstring

An alias for the column.

$autoboolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
TypeDescription
stringThe quoted identifier and alias.
methodpublicquoteIdentifier(string | array | \Zend_Db_Expr $ident, boolean $auto = false) : string

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
NameTypeDescription
$identstring | array | \Zend_Db_Expr

The identifier.

$autoboolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
TypeDescription
stringThe 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()\Zend_Db_Adapter_Pdo_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
NameTypeDescription
$textstring

The text with a placeholder.

$valuemixed

The value to quote.

$typestring

OPTIONAL SQL datatype

$countinteger

OPTIONAL count of placeholders to replace

Returns
TypeDescription
stringAn 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()\Zend_Db_Adapter_Pdo_Abstract::quoteTableAs()
Parameters
NameTypeDescription
$identstring | array | \Zend_Db_Expr

The identifier or expression.

$aliasstring

An alias for the table.

$autoboolean

If true, heed the AUTO_QUOTE_IDENTIFIERS config option.

Returns
TypeDescription
stringThe 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()\Zend_Db_Adapter_Pdo_Abstract::rollBack()
Returns
TypeDescription
\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()\Zend_Db_Adapter_Pdo_Abstract::select()
Returns
TypeDescription
\Zend_Db_Select
methodpublicsetFetchMode(int $mode) : void
inherited

Set the PDO fetch mode.

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::setFetchMode()
Parameters
NameTypeDescription
$modeint

A PDO fetch mode.

Throws
ExceptionDescription
\Zend_Db_Adapter_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()\Zend_Db_Adapter_Pdo_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
NameTypeDescription
$profiler\Zend_Db_Profiler | \Zend_Config | array | boolean
Returns
TypeDescription
\Zend_Db_Adapter_AbstractProvides a fluent interface
Throws
ExceptionDescription
\Zend_Db_Profiler_Exceptionif the object instance or class specified is not Zend_Db_Profiler or an extension of that class.
methodpublicsetStatementClass( $class) : \Zend_Db_Adapter_Abstract
Parameters
NameTypeDescription
$class
Returns
TypeDescription
\Zend_Db_Adapter_AbstractFluent interface
methodpublicsupportsParameters(string $type) : bool
inherited

Check if the adapter supports real SQL parameters.

Inherited from: \Zend_Db_Adapter_Pdo_Abstract::supportsParameters()
Parameters
NameTypeDescription
$typestring

'positional' or 'named'

Returns
TypeDescription
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()\Zend_Db_Adapter_Pdo_Abstract::update()
Parameters
NameTypeDescription
$tablemixed

The table to update.

$bindarray

Column-value pairs.

$wheremixed

UPDATE WHERE clause(s).

Returns
TypeDescription
intThe number of affected rows.
Throws
ExceptionDescription
\Zend_Db_Adapter_Exception
Documentation was generated by phpDocumentor 2.0.0a12.