OXID eShop CE  4.10.5
 All Classes Namespaces Files Functions Variables Pages
oxDb Class Reference
+ Collaboration diagram for oxDb:

Public Member Functions

 quoteArray ($aStrArray)
 resetTblDescCache ()
 getTableDescription ($sTableName)
 isValidFieldName ($sField)
 escapeString ($sString)

Static Public Member Functions

static setConfig ($oConfig)
static getInstance ()
static getDb ($iFetchMode=oxDb::FETCH_MODE_NUM)

Public Attributes

const FETCH_MODE_NUM = ADODB_FETCH_NUM
const FETCH_MODE_ASSOC = ADODB_FETCH_ASSOC

Static Public Attributes

static $configSet = false

Protected Member Functions

 isAdmin ()
 _getModules ()
 _registerAdoDbExceptionHandler ()
 _setUp ($oDb)
 _sendMail ($sEmail, $sSubject, $sBody)
 _notifyConnectionErrors ($oDb)
 _onConnectionError ($oDb)
 _getDbInstance ($iInstType=false)
 _getConnectionId ()

Static Protected Member Functions

static _getConfigParam ($sConfigName)

Static Protected Attributes

static $_instance = null
static $_oDB = null
static $_aTblDescCache = array()

Static Private Attributes

static $_dbType = ''
static $_dbUser = ''
static $_dbPwd = ''
static $_dbName = ''
static $_dbHost = ''
static $_iDebug = 0
static $_blLogChangesInAdmin = false
static $_iUtfMode = 0
static $_sDefaultDatabaseConnection = null
static $_aSlaveHosts
static $_sAdminEmail
static $_iMasterSlaveBalance
static $_sLocalTimeFormat
static $_sLocalDateFormat

Detailed Description

Database connection class

Definition at line 10 of file oxdb.php.

Member Function Documentation

static oxDb::_getConfigParam (   $sConfigName)
staticprotected

Return local config value by given name.

Parameters
string$sConfigNamereturning config name.
Returns
mixed

Definition at line 187 of file oxdb.php.

oxDb::_getConnectionId ( )
protected

Get connection ID

Returns
link identifier

Definition at line 555 of file oxdb.php.

oxDb::_getDbInstance (   $iInstType = false)
protected

Returns database instance object for given type

Parameters
int$iInstTypeinstance type
Returns
ADONewConnection

Definition at line 404 of file oxdb.php.

oxDb::_getModules ( )
protected

Returns adodb modules string

Returns
string

Definition at line 236 of file oxdb.php.

oxDb::_notifyConnectionErrors (   $oDb)
protected

Notifying shop owner about connection problems

Parameters
ADOConnection$oDbdatabase connection instance

Definition at line 332 of file oxdb.php.

oxDb::_onConnectionError (   $oDb)
protected

In case of connection error - redirects to setup or send notification message for shop owner

Parameters
ADOConnection$oDbdatabase connection instance

Definition at line 371 of file oxdb.php.

oxDb::_registerAdoDbExceptionHandler ( )
protected

Registers AdoDb exceptions handler for SQL errors

Definition at line 258 of file oxdb.php.

oxDb::_sendMail (   $sEmail,
  $sSubject,
  $sBody 
)
protected

Returns $oMailer instance

Parameters
string$sEmailemail address
string$sSubjectsubject
string$sBodyemail body
Returns
phpmailer

Definition at line 312 of file oxdb.php.

oxDb::_setUp (   $oDb)
protected

Setting up connection parameters - sql mode, encoding, logging etc

Parameters
ADOConnection$oDbdatabase connection instance

Definition at line 271 of file oxdb.php.

oxDb::escapeString (   $sString)

Escape string for using in mysql statements

Parameters
string$sStringstring which will be escaped
Deprecated:
since v5.3.0 (2016-06-06); This method will be removed in v6.0. Use oxLegacyDb::quote() to quote values. As of v6.0 there will be a new method quoteIdentifier() to quote strings in order to use them as identifiers.
Returns
string

Definition at line 570 of file oxdb.php.

static oxDb::getDb (   $iFetchMode = oxDb::FETCH_MODE_NUM)
static

Returns database object

Parameters
int$iFetchMode- fetch mode default numeric - 0
Exceptions
oxConnectionExceptionerror while initiating connection to DB
Returns
DatabaseInterface

Definition at line 435 of file oxdb.php.

static oxDb::getInstance ( )
static

Returns Singleton instance

Returns
oxdb

Definition at line 201 of file oxdb.php.

oxDb::getTableDescription (   $sTableName)

Extracts and returns table metadata from DB.

Parameters
string$sTableNameName of table to invest.
Returns
array

Definition at line 521 of file oxdb.php.

oxDb::isAdmin ( )
protected

Cal function is admin from oxFunction. Need to mock in tests.

Returns
bool

Definition at line 226 of file oxdb.php.

oxDb::isValidFieldName (   $sField)

Checks if given string is valid database field name. It must contain from alphanumeric plus dot and underscore symbols

Parameters
string$sFieldfield name
Deprecated:
since v5.3.0 (2016-06-06); This method will be removed in v6.0.
Returns
bool

Definition at line 545 of file oxdb.php.

oxDb::quoteArray (   $aStrArray)

Quotes an array.

Parameters
array$aStrArrayarray of strings to quote
Deprecated:
since v5.2.0 (2014-03-12); use oxLegacyDb::quoteArray()
Returns
array

Definition at line 499 of file oxdb.php.

oxDb::resetTblDescCache ( )

Call to reset table description cache

Deprecated:
since v5.3.0 (2016-06-06); This method will be removed in v6.0.

Definition at line 509 of file oxdb.php.

static oxDb::setConfig (   $oConfig)
static

Sets configs object with method getVar() and properties needed for successful connection.

Parameters
object$oConfigconfigs.

Definition at line 160 of file oxdb.php.

Member Data Documentation

oxDb::$_aSlaveHosts
staticprivate

Definition at line 123 of file oxdb.php.

oxDb::$_aTblDescCache = array()
staticprotected

Definition at line 53 of file oxdb.php.

oxDb::$_blLogChangesInAdmin = false
staticprivate

Definition at line 102 of file oxdb.php.

oxDb::$_dbHost = ''
staticprivate

Definition at line 88 of file oxdb.php.

oxDb::$_dbName = ''
staticprivate

Definition at line 81 of file oxdb.php.

oxDb::$_dbPwd = ''
staticprivate

Definition at line 74 of file oxdb.php.

oxDb::$_dbType = ''
staticprivate

Definition at line 60 of file oxdb.php.

oxDb::$_dbUser = ''
staticprivate

Definition at line 67 of file oxdb.php.

oxDb::$_iDebug = 0
staticprivate

Definition at line 95 of file oxdb.php.

oxDb::$_iMasterSlaveBalance
staticprivate

Definition at line 139 of file oxdb.php.

oxDb::$_instance = null
staticprotected

Definition at line 39 of file oxdb.php.

oxDb::$_iUtfMode = 0
staticprivate

Definition at line 109 of file oxdb.php.

oxDb::$_oDB = null
staticprotected

Definition at line 46 of file oxdb.php.

oxDb::$_sAdminEmail
staticprivate

Definition at line 130 of file oxdb.php.

oxDb::$_sDefaultDatabaseConnection = null
staticprivate

Definition at line 116 of file oxdb.php.

oxDb::$_sLocalDateFormat
staticprivate

Definition at line 153 of file oxdb.php.

oxDb::$_sLocalTimeFormat
staticprivate

Definition at line 146 of file oxdb.php.

oxDb::$configSet = false
static

Definition at line 32 of file oxdb.php.

const oxDb::FETCH_MODE_ASSOC = ADODB_FETCH_ASSOC

Definition at line 25 of file oxdb.php.

const oxDb::FETCH_MODE_NUM = ADODB_FETCH_NUM

Definition at line 18 of file oxdb.php.


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