Class: DB_common
Source Location: /test/mockDB/DB.php
PEAR
|
--DB_common
Mock DB_common for testing
Author(s):
|
|
|
Class Details
Class Variables
Class Methods
constructor DB_common [line 935]
This constructor calls $this->PEAR('DB_Error')
method affectedRows [line 2008]
Determines the number of rows affected by a data maniuplation query - is returned for queries that don't manipulate data.
Tags:
Overridden in child classes as:
- DB_mysql::affectedRows()
- Determines the number of rows affected by a data maniuplation query
method autoCommit [line 1961]
int autoCommit(
[bool
$onoff = false])
|
|
Enables or disables automatic commits
Tags:
Overridden in child classes as:
- DB_mysql::autoCommit()
- Enables or disables automatic commits
Parameters:
method autoExecute [line 1220]
mixed autoExecute(
string
$table, array
$fields_values, [int
$mode = DB_AUTOQUERY_INSERT], [string
$where = false])
|
|
Automaticaly generates an insert or update query and call prepare() and execute() with it
Tags:
Parameters:
method autoPrepare [line 1190]
resource autoPrepare(
string
$table, array
$table_fields, [int
$mode = DB_AUTOQUERY_INSERT], [string
$where = false])
|
|
Automaticaly generates an insert or update query and pass it to prepare()
Tags:
Parameters:
method buildManipSQL [line 1249]
string buildManipSQL(
string
$table, array
$table_fields, int
$mode, [string
$where = false])
|
|
Produces an SQL query string for autoPrepare()
Tags:
Parameters:
method commit [line 1972]
Commits the current transaction
Tags:
Overridden in child classes as:
- DB_mysql::commit()
- Commits the current transaction
method createSequence [line 2056]
int createSequence(
string
$seq_name)
|
|
Creates a new sequence
Tags:
Overridden in child classes as:
- DB_mysql::createSequence()
- Creates a new sequence
Parameters:
method dropSequence [line 2070]
int dropSequence(
string
$seq_name)
|
|
Deletes a sequence
Tags:
Overridden in child classes as:
- DB_mysql::dropSequence()
- Deletes a sequence
Parameters:
method errorCode [line 2153]
int errorCode(
string|int
$nativecode)
|
|
Maps native error codes to DB's portable ones Uses the $errorcode_map property defined in each driver.
Tags:
Parameters:
method errorMessage [line 2171]
string errorMessage(
integer
$dbcode)
|
|
Maps a DB error code to a textual message
Tags:
Parameters:
method errorNative [line 2136]
Gets the DBMS' native error code produced by the last query
Tags:
Overridden in child classes as:
- DB_mysql::errorNative()
- Gets the DBMS' native error code produced by the last query
method escapeSimple [line 1047]
string escapeSimple(
string
$str)
|
|
Escapes a string according to the current DBMS's standards
Tags:
Overridden in child classes as:
- DB_mysql::escapeSimple()
- Escapes a string according to the current DBMS's standards
Parameters:
method execute [line 1307]
mixed &execute(
resource
$stmt, [mixed
$data = array()])
|
|
Executes a DB statement prepared with prepare()
Tags:
Parameters:
method executeEmulateQuery [line 1341]
mixed executeEmulateQuery(
resource
$stmt, [mixed
$data = array()])
|
|
Emulates executing prepared statements if the DBMS not support them
Tags:
Parameters:
method executeMultiple [line 1387]
int executeMultiple(
resource
$stmt, array
$data)
|
|
Performs several execute() calls on the same statement handle
Tags:
Parameters:
method expect_queries [line 1478]
void expect_queries(
string
$list)
|
|
Set list of expected queries and returns This is a test routine that does not exist in the PEAR DB package.
Tags:
Parameters:
method expect_query [line 1467]
void expect_query(
string
$expected, string
$result)
|
|
Set expected query and return This is a test routine that does not exist in the PEAR DB package.
Tags:
Parameters:
method freePrepared [line 1411]
bool freePrepared(
resource
$stmt, [bool
$free_resource = true])
|
|
Frees the internal resources associated with a prepared query
Tags:
Parameters:
method getAll [line 1896]
array &getAll(
string
$query, [mixed
$params = array()], [int
$fetchmode = DB_FETCHMODE_DEFAULT])
|
|
Fetches all of the rows from a query result
Tags:
Parameters:
method getAssoc [line 1787]
array &getAssoc(
string
$query, [bool
$force_array = false], [mixed
$params = array()], [int
$fetchmode = DB_FETCHMODE_DEFAULT], [bool
$group = false])
|
|
Fetches an entire query result and returns it as an associative array using the first column as the key
Tags:
Parameters:
method getCol [line 1716]
array &getCol(
string
$query, [mixed
$col = 0], [mixed
$params = array()])
|
|
Fetches a single column from a query result and returns it as an indexed array
Tags:
Parameters:
method getListOf [line 2219]
array getListOf(
string
$type)
|
|
Lists internal database information
Tags:
Parameters:
method getOne [line 1609]
mixed &getOne(
string
$query, [mixed
$params = array()])
|
|
Fetches the first column of the first row from a query result
Tags:
Parameters:
method getOption [line 1120]
mixed getOption(
string
$option)
|
|
Returns the value of an option
Tags:
Parameters:
method getRow [line 1652]
array &getRow(
string
$query, [mixed
$params = array()], [int
$fetchmode = DB_FETCHMODE_DEFAULT])
|
|
Fetches the first row of data returned from a query result
Tags:
Parameters:
method getSequenceName [line 2022]
string getSequenceName(
string
$sqn)
|
|
Generates the name used inside the database for a sequence
Tags:
Parameters:
method getSpecialQuery [line 2245]
string getSpecialQuery(
string
$type)
|
|
Obtains the query string needed for listing a given type of objects
Tags:
Overridden in child classes as:
- DB_mysql::getSpecialQuery()
- Obtains the query string needed for listing a given type of objects
Parameters:
method limitQuery [line 1581]
mixed &limitQuery(
string
$query, intr
$from, int
$count, [mixed
$params = array()])
|
|
Generates and executes a LIMIT query
Tags:
Parameters:
method modifyLimitQuery [line 1454]
string modifyLimitQuery(
string
$query, int
$from, int
$count, [mixed
$params = array()])
|
|
Adds LIMIT clauses to a query string according to current DBMS standards
Tags:
Overridden in child classes as:
- DB_mysql::modifyLimitQuery()
- Adds LIMIT clauses to a query string according to current DBMS standards
Parameters:
method modifyQuery [line 1434]
string modifyQuery(
string
$query)
|
|
Changes a query string for various DBMS specific reasons
Tags:
Overridden in child classes as:
- DB_mysql::modifyQuery()
- Changes a query string for various DBMS specific reasons
Parameters:
method nextId [line 2042]
int nextId(
string
$seq_name, [boolean
$ondemand = true])
|
|
Returns the next free id in a sequence
Tags:
Overridden in child classes as:
- DB_mysql::nextId()
- Returns the next free id in a sequence
Parameters:
method numRows [line 1995]
int numRows(
resource
$result)
|
|
Determines the number of rows in a query result
Tags:
Overridden in child classes as:
- DB_mysql::numRows()
- Gets the number of rows in a result set
Parameters:
method prepare [line 1137]
mixed prepare(
string
$query)
|
|
Prepares a query for multiple execution with execute()
Tags:
Parameters:
method provides [line 1059]
bool provides(
string
$feature)
|
|
Tells whether the present driver supports a given feature
Tags:
Parameters:
method query [line 1514]
mixed &query(
string
$query, [mixed
$params = array()])
|
|
Sends a query to the database server
Tags:
Parameters:
method quoteIdentifier [line 1015]
string quoteIdentifier(
string
$str)
|
|
Quotes a string so it can be safely used as a table or column name
Tags:
Overridden in child classes as:
- DB_mysql::quoteIdentifier()
- Quotes a string so it can be safely used as a table or column name
Parameters:
method quoteSmart [line 1026]
void quoteSmart(
mixed
$in)
|
|
Formats input so it can be safely used in a query
Tags:
method raiseError [line 2099]
object the &raiseError(
[mixed
$code = DB_ERROR], [int
$mode = null], [mixed
$options = null], [string
$userinfo = null], [mixed
$nativecode = null])
|
|
Communicates an error and invoke error callbacks, etc Basically a wrapper for PEAR::raiseError without the message string.
Tags:
Parameters:
method rollback [line 1983]
Reverts the current transaction
Tags:
Overridden in child classes as:
- DB_mysql::rollback()
- Reverts the current transaction
method setFetchMode [line 1080]
void setFetchMode(
integer
$fetchmode, [string
$object_class = 'stdClass'])
|
|
Sets the fetch mode that should be used by default for query results
Tags:
Parameters:
method setOption [line 1103]
int setOption(
string
$option, mixed
$value)
|
|
Sets run-time configuration options for PEAR DB
Tags:
Parameters:
method tableInfo [line 2197]
array tableInfo(
object|string
$result, [int
$mode = null])
|
|
Returns information about a table or a result set
Tags:
Overridden in child classes as:
- DB_mysql::tableInfo()
- Returns information about a table or a result set
Parameters:
method tally_queries [line 1490]
Verify that all expected queries have been received This is a test routine that does not exist in the PEAR DB package.
Tags:
method _convertNullArrayValuesToEmpty [line 2271]
void _convertNullArrayValuesToEmpty(
array
&$array)
|
|
Converts all null values in an array to empty strings
Tags:
Parameters:
method _rtrimArrayValues [line 2256]
void _rtrimArrayValues(
array
&$array)
|
|
Right-trims all strings in an array
Tags:
Parameters:
method __sleep [line 947]
Automatically indicates which properties should be saved when PHP's serialize() function is called
Tags:
method __toString [line 997]
Automatic string conversion for PHP 5
Tags:
method __wakeup [line 984]
Automatically reconnects to the database when PHP's unserialize() function is called
Tags:
|
|