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

oxDb Class Reference

Inheritance diagram for oxDb:
Collaboration diagram for oxDb:

List of all members.

Public Member Functions

 getMultiLangFieldName ($sField)
 isQuoteNeeded ($sFieldtype)
 quoteArray ($aStrArray)
 resetTblDescCache ()
 getTableDescription ($sTableName)
 convertDBDateTime ($oObject, $blToTimeStamp=false, $blOnlyDate=false)
 convertDBTimestamp ($oObject, $blToTimeStamp=false)
 convertDBDate ($oObject, $blToTimeStamp=false)
 createSQLList ($aArray)
 isValidFieldName ($sField)
 escapeString ($sString)
 updateViews ($aTables=null)

Static Public Member Functions

static getInstance ()
static getDb ($blAssoc=false)
static startTransaction ()
static commitTransaction ()
static rollbackTransaction ()
static setTransactionIsolationLevel ($sLevel=null)

Protected Member Functions

 _setDefaultFormatedValue ($oObject, $sDate, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
 _defineAndCheckDefaultTimeValues ($blToTimeStamp)
 _defineAndCheckDefaultDateValues ($blToTimeStamp)
 _defaultDatePattern ()
 _defaultTimePattern ()
 _regexp2ValidateDateInput ()
 _regexp2ValidateTimeInput ()
 _defineDateFormattingRules ()
 _defineTimeFormattingRules ()
 _setDefaultDateTimeValue ($oObject, $sLocalDateFormat, $sLocalTimeFormat, $blOnlyDate)
 _setDate ($oObject, $sDateFormat, $aDFields, $aDateMatches)
 _formatCorrectTimeValue ($oObject, $sDateFormat, $sTimeFormat, $aDateMatches, $aTimeMatches, $aTFields, $aDFields)
 _getConnectionId ()

Static Protected Attributes

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

Detailed Description

Database connection class

Definition at line 10 of file oxdb.php.


Member Function Documentation

oxDb._defaultDatePattern (  )  [protected]

sets default date pattern

Returns:
array

Definition at line 639 of file oxdb.php.

oxDb._defaultTimePattern (  )  [protected]

sets default time pattern

Returns:
array

Definition at line 654 of file oxdb.php.

oxDb._defineAndCheckDefaultDateValues ( blToTimeStamp  )  [protected]

defines and checks default date values

Parameters:
bool $blToTimeStamp marker how to format
Returns:
string

Definition at line 623 of file oxdb.php.

oxDb._defineAndCheckDefaultTimeValues ( blToTimeStamp  )  [protected]

defines and checks dafault time values

Parameters:
bool $blToTimeStamp -
Returns:
string

Definition at line 605 of file oxdb.php.

oxDb._defineDateFormattingRules (  )  [protected]

define date formatting rules

Returns:
array

Definition at line 699 of file oxdb.php.

oxDb._defineTimeFormattingRules (  )  [protected]

defines time formatting rules

Returns:
array

Definition at line 714 of file oxdb.php.

oxDb._formatCorrectTimeValue ( oObject,
sDateFormat,
sTimeFormat,
aDateMatches,
aTimeMatches,
aTFields,
aDFields 
) [protected]

Formatting correct time value

Parameters:
object $oObject data field object
string $sDateFormat date format
string $sTimeFormat time format
array $aDateMatches new new date
array $aTimeMatches new time
array $aTFields defines the time fields
array $aDFields defines the date fields
Returns:
null

Definition at line 792 of file oxdb.php.

oxDb._getConnectionId (  )  [protected]

Get connection ID

Returns:
link identifier

Definition at line 817 of file oxdb.php.

oxDb._regexp2ValidateDateInput (  )  [protected]

regular expressions to validate date input

Returns:
array

Definition at line 669 of file oxdb.php.

oxDb._regexp2ValidateTimeInput (  )  [protected]

regular expressions to validate time input

Returns:
array

Definition at line 684 of file oxdb.php.

oxDb._setDate ( oObject,
sDateFormat,
aDFields,
aDateMatches 
) [protected]

sets date

Parameters:
object $oObject date field object
string $sDateFormat date format
array $aDFields days
array $aDateMatches new date as array (month, year)
Returns:
null

Definition at line 763 of file oxdb.php.

oxDb._setDefaultDateTimeValue ( oObject,
sLocalDateFormat,
sLocalTimeFormat,
blOnlyDate 
) [protected]

Sets default date time value

Parameters:
object $oObject date field object
string $sLocalDateFormat input format
string $sLocalTimeFormat local format
bool $blOnlyDate marker to format only date field (no time)
Returns:
null

Definition at line 734 of file oxdb.php.

oxDb._setDefaultFormatedValue ( oObject,
sDate,
sLocalDateFormat,
sLocalTimeFormat,
blOnlyDate 
) [protected]

sets default formatted value

Parameters:
object $oObject date field object
string $sDate prefered date
string $sLocalDateFormat input format
string $sLocalTimeFormat local format
bool $blOnlyDate marker to format only date field (no time)
Returns:
null

Definition at line 569 of file oxdb.php.

static oxDb.commitTransaction (  )  [static]

Commit mysql transaction

Returns:
null

Definition at line 512 of file oxdb.php.

oxDb.convertDBDate ( oObject,
blToTimeStamp = false 
)

Bidirectional converter for date field

Parameters:
object $oObject oxField type object that keeps db field info
bool $blToTimeStamp if true - converts value to database compatible timestamp value
Returns:
string

Definition at line 467 of file oxdb.php.

oxDb.convertDBDateTime ( oObject,
blToTimeStamp = false,
blOnlyDate = false 
)

Bidirectional converter for date/datetime field

Parameters:
object $oObject data field object
bool $blToTimeStamp set TRUE to format MySQL compatible value
bool $blOnlyDate set TRUE to format "date" type field
Returns:
string

Definition at line 297 of file oxdb.php.

oxDb.convertDBTimestamp ( oObject,
blToTimeStamp = false 
)

Bidirectional converter for timestamp field

Parameters:
object $oObject oxField type object that keeps db field info
bool $blToTimeStamp if true - converts value to database compatible timestamp value
Returns:
string

Definition at line 417 of file oxdb.php.

oxDb.createSQLList ( aArray  ) 

Takes Array and creates IN() list for SQL statement

Parameters:
array $aArray array of string to join
Returns:
string

Definition at line 479 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 833 of file oxdb.php.

static oxDb.getDb ( blAssoc = false  )  [static]

Returns database object

Parameters:
boolean $blAssoc default false
Exceptions:
oxConnectionException error while initiating connection to DB
Returns:
ADOConnection

Definition at line 67 of file oxdb.php.

static oxDb.getInstance (  )  [static]

Returns Singelton instance

Returns:
oxdb

Definition at line 38 of file oxdb.php.

oxDb.getMultiLangFieldName ( sField  ) 

Returns database field name with _ Language ID if needed

Parameters:
string $sField the field name
Returns:
string

Definition at line 217 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 274 of file oxdb.php.

oxDb.isQuoteNeeded ( sFieldtype  ) 

Checks if field, according to field type, must be surrounded with quote symbols. Returns true if yes.

Parameters:
string $sFieldtype Type of field
Returns:
bool

Definition at line 236 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 553 of file oxdb.php.

oxDb.quoteArray ( aStrArray  ) 

Quotes an array.

Parameters:
array $aStrArray array of strings to quote
Returns:
array

Definition at line 249 of file oxdb.php.

oxDb.resetTblDescCache (  ) 

Call to reset table description cache

Returns:
null

Definition at line 262 of file oxdb.php.

static oxDb.rollbackTransaction (  )  [static]

RollBack mysql transaction

Returns:
null

Definition at line 522 of file oxdb.php.

static oxDb.setTransactionIsolationLevel ( sLevel = null  )  [static]

Set transaction isolation level Allowed values READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE

Parameters:
string $sLevel level
Returns:
null

Definition at line 535 of file oxdb.php.

static oxDb.startTransaction (  )  [static]

Start mysql transaction

Returns:
null

Definition at line 502 of file oxdb.php.

oxDb.updateViews ( aTables = null  ) 

Updates shop views

Parameters:
array $aTables If you need to update specific tables, just pass its names as array [optional]
Returns:
null

Definition at line 845 of file oxdb.php.


Member Data Documentation

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

Definition at line 31 of file oxdb.php.

oxDb.$_instance = null [static, protected]

Definition at line 17 of file oxdb.php.

oxDb.$_oDB = null [static, protected]

Definition at line 24 of file oxdb.php.


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