Zend_Db_Adapter_AbstractClass for connecting to SQL databases and performing common operations.
Located in /Db/Adapter/Abstract.php (line 43)
| Class | Description |
|---|---|
Zend_Db_Adapter_Pdo_Abstract
|
Class for connecting to SQL databases and performing common operations using PDO. |
Zend_Db_Adapter_Db2
|
|
Zend_Db_Adapter_Mysqli
|
|
Zend_Db_Adapter_Sqlsrv
|
|
Zend_Db_Adapter_Oracle
|
|
Zend_Test_DbAdapter
|
Testing Database Adapter which acts as a stack for SQL Results |
string
quoteTableAs
(string|array|Zend_Db_Expr $ident, [string $alias = null], [boolean $auto = false])
string
_quoteIdentifierAs
(string|array|Zend_Db_Expr $ident, [string $alias = null], [boolean $auto = false], [string $as = ' AS '])
bool
$_allowSerialization
= true (line 132)
Weither or not that object can get serialized
bool
$_autoQuoteIdentifiers
= true (line 109)
Specifies whether the adapter automatically quotes identifiers.
If true, most SQL generated by Zend_Db classes applies identifier quoting automatically. If false, developer must quote identifiers themselves by calling quoteIdentifier().
bool
$_autoReconnectOnUnserialize
= false (line 140)
Weither or not the database should be reconnected to that adapter when waking up
integer
$_caseFolding
= Zend_Db::CASE_NATURAL (line 98)
Specifies the case of column names retrieved in queries
Options Zend_Db::CASE_NATURAL (default) Zend_Db::CASE_LOWER Zend_Db::CASE_UPPER
array
$_config
= array() (line 51)
User-provided configuration
object|resource|null
$_connection
= null (line 87)
Database connection
string
$_defaultProfilerClass
= 'Zend_Db_Profiler' (line 80)
Default class name for the profiler object.
string
$_defaultStmtClass
= 'Zend_Db_Statement' (line 73)
Default class name for a DB statement.
integer
$_fetchMode
= Zend_Db::FETCH_ASSOC (line 58)
Fetch mode
array
$_numericDataTypes
= array(Keys are UPPERCASE SQL datatypes or the constants Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
Values are:
Zend_Db_Profiler
$_profiler
(line 66)
Query profiler object, of type Zend_Db_Profiler or a subclass of that.
Constructor __construct (line 163)
Constructor.
$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
beginTransaction (line 480)
Leave autocommit mode and begin a transaction.
closeConnection (line 1178)
Force the connection to close.
commit (line 494)
Commit a transaction and return to autocommit mode.
delete (line 619)
Deletes table rows based on a WHERE clause.
describeTable (line 1157)
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
fetchAll (line 701)
Fetches all SQL result rows as a sequential array.
Uses the current fetchMode for the adapter.
fetchAssoc (line 743)
Fetches all SQL result rows as an associative array.
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.
fetchCol (line 763)
Fetches the first column of all SQL result rows as an array.
The first column in each row is used as the array key.
fetchOne (line 797)
Fetches the first column of the first row of the SQL result.
fetchPairs (line 780)
Fetches all SQL result rows as an array of key-value pairs.
The first column is the key, the second column is the value.
fetchRow (line 720)
Fetches the first row of the SQL result.
Uses the current fetchMode for the adapter.
foldCase (line 1073)
Helper method to change the case of the strings used when returning result sets in FETCH_ASSOC and FETCH_BOTH modes.
This is not intended to be used by application code, but the method must be public so the Statement class can invoke it.
getConfig (line 313)
Returns the configuration variables in this adapter.
getConnection (line 302)
Returns the underlying database connection object or resource.
If not presently connected, this initiates the connection.
getFetchMode (line 687)
Get the fetch mode.
getQuoteIdentifierSymbol (line 1030)
Returns the symbol the adapter uses for delimited identifiers.
getServerVersion (line 1251)
Retrieve server version in PHP style
getStatementClass (line 421)
Get the default statement class.
insert (line 524)
Inserts a table row with specified data.
isConnected (line 1171)
Test if a connection is active
lastInsertId (line 1202)
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.
lastSequenceId (line 1043)
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.
limit (line 1236)
Adds an adapter-specific LIMIT clause to the SELECT statement.
listTables (line 1128)
Returns a list of the tables in the database.
nextSequenceId (line 1056)
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.
prepare (line 1186)
Prepare a statement and return a PDOStatement-like object.
query (line 445)
Prepares and executes an SQL statement with bound data.
quote (line 830)
Safely quotes a value for an SQL statement.
If an array is passed as the value, the array values are quoted and then returned as a comma-separated string.
quoteColumnAs (line 949)
Quote a column identifier and alias.
quoteIdentifier (line 936)
Quotes an identifier.
Accepts a string representing a qualified indentifier. For Example:
Or, an array of one or more identifiers that may form a qualified identifier:
The actual quote character surrounding the identifiers may vary depending on the adapter.
quoteInto (line 899)
Quotes a value and places into a piece of text at a placeholder.
The placeholder is a question-mark; all placeholders will be replaced with the quoted value. For example:
quoteTableAs (line 962)
Quote a table identifier and alias.
rollBack (line 508)
Roll back a transaction and return to autocommit mode.
select (line 677)
Creates and returns a new Zend_Db_Select object for this adapter.
setFetchMode (line 1226)
Set the fetch mode.
setProfiler (line 346)
Set the adapter's profiler object.
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.
setStatementClass (line 431)
Set the default statement class.
supportsParameters (line 1244)
Check if the adapter supports real SQL parameters.
update (line 559)
Updates table rows with specified data based on a WHERE clause.
_beginTransaction (line 1207)
Begin a transaction.
_checkRequiredOptions (line 270)
Check for config options that are mandatory.
Throw exceptions if any are missing.
_commit (line 1212)
Commit a transaction.
_connect (line 1164)
Creates a connection to the database.
_quote (line 810)
Quote a raw string.
_quoteIdentifier (line 1016)
Quote an identifier.
_quoteIdentifierAs (line 976)
Quote an identifier and an optional alias.
_rollBack (line 1217)
Roll-back a transaction.
_whereExpr (line 645)
Convert an array, string, or Zend_Db_Expr object into a string to put in a WHERE clause.
__sleep (line 1096)
called when object is getting serialized This disconnects the DB object that cant be serialized
__wakeup (line 1112)
called when object is getting unserialized
Documentation generated on Mon, 21 Jun 2010 15:05:24 -0400 by phpDocumentor 1.4.3