Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Static Protected Attributes | Static Private Attributes

oxDb Class Reference

Collaboration diagram for oxDb:

List of all members.

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  )  [static, protected]

Return local config value by given name.

Parameters:
string $sConfigName returning config name.
Returns:
mixed

Definition at line 183 of file oxdb.php.

oxDb._getConnectionId (  )  [protected]

Get connection ID

Returns:
link identifier

Definition at line 539 of file oxdb.php.

oxDb._getDbInstance ( iInstType = false  )  [protected]

Returns database instance object for given type

Parameters:
int $iInstType instance type
Returns:
ADONewConnection

Definition at line 396 of file oxdb.php.

oxDb._getModules (  )  [protected]

Returns adodb modules string

Returns:
string

Definition at line 232 of file oxdb.php.

oxDb._notifyConnectionErrors ( oDb  )  [protected]

Notifying shop owner about connection problems

Parameters:
ADOConnection $oDb database connection instance

Definition at line 324 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 $oDb database connection instance

Definition at line 363 of file oxdb.php.

oxDb._registerAdoDbExceptionHandler (  )  [protected]

Registers AdoDb exceptions handler for SQL errors

Definition at line 254 of file oxdb.php.

oxDb._sendMail ( sEmail,
sSubject,
sBody 
) [protected]

Returns $oMailer instance

Parameters:
string $sEmail email address
string $sSubject subject
string $sBody email body
Returns:
phpmailer

Definition at line 305 of file oxdb.php.

oxDb._setUp ( oDb  )  [protected]

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

Parameters:
ADOConnection $oDb database connection instance

Definition at line 267 of file oxdb.php.

oxDb.escapeString ( sString  ) 

Escape string for using in mysql statements

Parameters:
string $sString string which will be escaped
Returns:
string

Definition at line 551 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:
oxConnectionException error while initiating connection to DB
Returns:
oxLegacyDb

Definition at line 427 of file oxdb.php.

static oxDb.getInstance (  )  [static]

Returns Singleton instance

Returns:
oxdb

Definition at line 197 of file oxdb.php.

oxDb.getTableDescription ( sTableName  ) 

Extracts and returns table metadata from DB.

Parameters:
string $sTableName Name of table to invest.
Returns:
array

Definition at line 507 of file oxdb.php.

oxDb.isAdmin (  )  [protected]

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

Returns:
bool

Definition at line 222 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 $sField field name
Returns:
bool

Definition at line 529 of file oxdb.php.

oxDb.quoteArray ( aStrArray  ) 

Quotes an array.

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

Definition at line 487 of file oxdb.php.

oxDb.resetTblDescCache (  ) 

Call to reset table description cache

Definition at line 495 of file oxdb.php.

static oxDb.setConfig ( oConfig  )  [static]

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

Parameters:
object $oConfig configs.

Definition at line 158 of file oxdb.php.


Member Data Documentation

oxDb.$_aSlaveHosts [static, private]

Definition at line 123 of file oxdb.php.

oxDb.$_aTblDescCache = array() [static, protected]

Definition at line 53 of file oxdb.php.

oxDb.$_blLogChangesInAdmin = false [static, private]

Definition at line 102 of file oxdb.php.

oxDb.$_dbHost = '' [static, private]

Definition at line 88 of file oxdb.php.

oxDb.$_dbName = '' [static, private]

Definition at line 81 of file oxdb.php.

oxDb.$_dbPwd = '' [static, private]

Definition at line 74 of file oxdb.php.

oxDb.$_dbType = '' [static, private]

Definition at line 60 of file oxdb.php.

oxDb.$_dbUser = '' [static, private]

Definition at line 67 of file oxdb.php.

oxDb.$_iDebug = 0 [static, private]

Definition at line 95 of file oxdb.php.

oxDb.$_iMasterSlaveBalance [static, private]

Definition at line 137 of file oxdb.php.

oxDb.$_instance = null [static, protected]

Definition at line 39 of file oxdb.php.

oxDb.$_iUtfMode = 0 [static, private]

Definition at line 109 of file oxdb.php.

oxDb.$_oDB = null [static, protected]

Definition at line 46 of file oxdb.php.

oxDb.$_sAdminEmail [static, private]

Definition at line 130 of file oxdb.php.

oxDb.$_sDefaultDatabaseConnection = null [static, private]

Definition at line 116 of file oxdb.php.

oxDb.$_sLocalDateFormat [static, private]

Definition at line 151 of file oxdb.php.

oxDb.$_sLocalTimeFormat [static, private]

Definition at line 144 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: