oxDb Class Reference

Inheritance diagram for oxDb:

Inheritance graph
[legend]
Collaboration diagram for oxDb:

Collaboration graph
[legend]

List of all members.


Detailed Description

Database connection class

Definition at line 6 of file oxdb.php.


Public Member Functions

 getMultiLangFieldName ($sField)
 isQuoteNeeded ($sFieldtype)
 getTableDescription ($sTableName)
 convertDBDateTime ($oObject, $blToTimeStamp=false, $blOnlyDate=false)
 convertDBTimestamp ($oObject, $blToTimeStamp=false)
 convertDBDate ($oObject, $blToTimeStamp=false)
 createSQLList ($aArray)
 isValidFieldName ($sField)

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)

Static Protected Attributes

static $_aTblDescCache = array()

Static Private Attributes

static $_instance = null
static $_oDB = null

Member Function Documentation

static oxDb.getInstance (  )  [static]

Returns Singelton instance

Returns:
oxdb

Definition at line 34 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 64 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 213 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 232 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 245 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 268 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 387 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 436 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 448 of file oxdb.php.

static oxDb.startTransaction (  )  [static]

Start mysql transaction

Returns:
null

Definition at line 471 of file oxdb.php.

static oxDb.commitTransaction (  )  [static]

Commit mysql transaction

Returns:
null

Definition at line 481 of file oxdb.php.

static oxDb.rollbackTransaction (  )  [static]

RollBack mysql transaction

Returns:
null

Definition at line 491 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 504 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 522 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 538 of file oxdb.php.

oxDb._defineAndCheckDefaultTimeValues ( blToTimeStamp  )  [protected]

defines and checks dafault time values

Parameters:
bool $blToTimeStamp -
Returns:
string

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

oxDb._defaultDatePattern (  )  [protected]

sets default date pattern

Returns:
array

Definition at line 607 of file oxdb.php.

oxDb._defaultTimePattern (  )  [protected]

sets default time pattern

Returns:
array

Definition at line 622 of file oxdb.php.

oxDb._regexp2ValidateDateInput (  )  [protected]

regular expressions to validate date input

Returns:
array

Definition at line 637 of file oxdb.php.

oxDb._regexp2ValidateTimeInput (  )  [protected]

regular expressions to validate time input

Returns:
array

Definition at line 652 of file oxdb.php.

oxDb._defineDateFormattingRules (  )  [protected]

define date formatting rules

Returns:
array

Definition at line 667 of file oxdb.php.

oxDb._defineTimeFormattingRules (  )  [protected]

defines time formatting rules

Returns:
array

Definition at line 682 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 702 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 731 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 760 of file oxdb.php.


Member Data Documentation

oxDb.$_instance = null [static, private]

Definition at line 13 of file oxdb.php.

oxDb.$_oDB = null [static, private]

Definition at line 20 of file oxdb.php.

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

Definition at line 27 of file oxdb.php.


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

Generated on Tue Aug 18 09:24:20 2009 for OXID eShop CE by  doxygen 1.5.5