oxDb Class Reference
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:
 - 
  
 
- 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 202 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 221 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 234 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 257 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 376 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 425 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 437 of file oxdb.php.
 
 
      
        
          | static oxDb.startTransaction            | 
          ( | 
                     | 
           )  | 
           [static] | 
        
      
 
 
      
        
          | static oxDb.commitTransaction            | 
          ( | 
                     | 
           )  | 
           [static] | 
        
      
 
Commit mysql transaction
- Returns:
 - null 
 
Definition at line 470 of file oxdb.php.
 
 
      
        
          | static oxDb.rollbackTransaction            | 
          ( | 
                     | 
           )  | 
           [static] | 
        
      
 
RollBack mysql transaction
- Returns:
 - null 
 
Definition at line 480 of file oxdb.php.
 
 
      
        
          | static oxDb.setTransactionIsolationLevel            | 
          ( | 
          $  | 
           sLevel = null           | 
           )  | 
           [static] | 
        
      
 
Set transaction isolation level Allowed values READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE
- Parameters:
 - 
  
 
- Returns:
 - null 
 
Definition at line 493 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 511 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 527 of file oxdb.php.
 
 
      
        
          | oxDb._defineAndCheckDefaultTimeValues            | 
          ( | 
          $  | 
           blToTimeStamp           | 
           )  | 
           [protected] | 
        
      
 
defines and checks dafault time values
- Parameters:
 - 
  
 
- Returns:
 - string 
 
Definition at line 562 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 580 of file oxdb.php.
 
 
      
        
          | oxDb._defaultDatePattern            | 
          ( | 
                     | 
           )  | 
           [protected] | 
        
      
 
sets default date pattern
- Returns:
 - array 
 
Definition at line 596 of file oxdb.php.
 
 
      
        
          | oxDb._defaultTimePattern            | 
          ( | 
                     | 
           )  | 
           [protected] | 
        
      
 
sets default time pattern
- Returns:
 - array 
 
Definition at line 611 of file oxdb.php.
 
 
      
        
          | oxDb._regexp2ValidateDateInput            | 
          ( | 
                     | 
           )  | 
           [protected] | 
        
      
 
regular expressions to validate date input
- Returns:
 - array 
 
Definition at line 626 of file oxdb.php.
 
 
      
        
          | oxDb._regexp2ValidateTimeInput            | 
          ( | 
                     | 
           )  | 
           [protected] | 
        
      
 
regular expressions to validate time input
- Returns:
 - array 
 
Definition at line 641 of file oxdb.php.
 
 
      
        
          | oxDb._defineDateFormattingRules            | 
          ( | 
                     | 
           )  | 
           [protected] | 
        
      
 
define date formatting rules
- Returns:
 - array 
 
Definition at line 656 of file oxdb.php.
 
 
      
        
          | oxDb._defineTimeFormattingRules            | 
          ( | 
                     | 
           )  | 
           [protected] | 
        
      
 
defines time formatting rules
- Returns:
 - array 
 
Definition at line 671 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 691 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 720 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 749 of file oxdb.php.
 
 
Member Data Documentation
      
        
          oxDb.$_instance = null [static, private]           | 
        
      
 
 
      
        
          oxDb.$_oDB = null [static, private]           | 
        
      
 
 
      
        
          oxDb.$_aTblDescCache = array() [static, protected]           | 
        
      
 
 
The documentation for this class was generated from the following file: