OXID eShop CE  4.10.2
 All Classes Namespaces Files Functions Variables Pages
oxDbMetaDataHandler Class Reference
+ Inheritance diagram for oxDbMetaDataHandler:
+ Collaboration diagram for oxDbMetaDataHandler:

Public Member Functions

 getFields ($sTableName)
 tableExists ($sTableName)
 fieldExists ($sFieldName, $sTableName)
 getIndices ($tableName)
 hasIndex ($indexName, $tableName)
 getAllTables ()
 getAllMultiTables ($sTable)
 getAddFieldSql ($sTable, $sField, $sNewField, $sPrevField, $sTableSet=null)
 getAddFieldIndexSql ($sTable, $sField, $sNewField, $sTableSet=null)
 getCurrentMaxLangId ()
 getNextLangId ()
 getMultilangFields ($sTable)
 getSinglelangFields ($sTable, $iLang)
 addNewMultilangField ($sTable)
 resetMultilangFields ($iLangId, $sTableName)
 addNewLangToDb ()
 resetLanguage ($iLangId)
 executeSql ($aSql)
 updateViews ($aTables=null)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 __construct ()
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _getCreateTableSetSql ($sTable, $iLang)
 filterCoreFields ($aFields)
 safeGuardAdditionalMultiLanguageTables ()
 ensureMultiLanguageFields ($sTable, $iLanguageId)

Protected Attributes

 $_aDbTablesFields = null
 $_aTables = null
 $_iCurrentMaxLangId
 $_aSkipTablesOnReset = array("oxcountry")
 $aForceOriginalFields = array('OXID')

Additional Inherited Members

- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Class for handling database related operations

Definition at line 7 of file oxdbmetadatahandler.php.

Member Function Documentation

oxDbMetaDataHandler::_getCreateTableSetSql (   $sTable,
  $iLang 
)
protected

Get sql for new multi-language table set creation

Parameters
string$sTablecore table name
string$iLanglanguage id
Returns
string

Definition at line 192 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::addNewLangToDb ( )

Add new language to database. Scans all tables and adds new multi-language fields

Definition at line 438 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::addNewMultilangField (   $sTable)

Add new multi-languages fields to table. Duplicates all multi-language fields and fields indexes with next available language ID

Parameters
string$sTabletable name

Definition at line 392 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::ensureMultiLanguageFields (   $sTable,
  $iLanguageId 
)
protected

Make sure that all *_set* tables with all required multilanguage fields are created.

Parameters
$sTable
$iLanguagaId
Returns
null

Definition at line 592 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::executeSql (   $aSql)

Executes array of sql strings

Parameters
array$aSqlSQL query array

Definition at line 487 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::fieldExists (   $sFieldName,
  $sTableName 
)

Check if field exists in table

Parameters
string$sFieldNamefield name
string$sTableNametable name
Returns
bool

Definition at line 85 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::filterCoreFields (   $aFields)
protected

Make sure that e.g. OXID is always used from core table when creating views. Otherwise we might have unwanted side effects from rows with OXIDs null in view tables.

Parameters
$fieldsLanguage fields array we need to filter for core fields.
Returns
array

Definition at line 547 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getAddFieldIndexSql (   $sTable,
  $sField,
  $sNewField,
  $sTableSet = null 
)

Get sql for new multi-language field index creation

Parameters
string$sTablecore table name
string$sFieldfield name
string$sNewFieldnew field name
string$sTableSettable to change (if not set take core table)
Returns
string

Definition at line 252 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getAddFieldSql (   $sTable,
  $sField,
  $sNewField,
  $sPrevField,
  $sTableSet = null 
)

Get sql for new multi-language field creation

Parameters
string$sTablecore table name
string$sFieldfield name
string$sNewFieldnew field name
string$sPrevFieldprevious field in table
string$sTableSettable to change (if not set take core table)
Returns
string

Definition at line 216 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getAllMultiTables (   $sTable)

return all DB tables for the language sets

Parameters
string$sTabletable name to check
Returns
array

Definition at line 170 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getAllTables ( )

Get all tables names from db. Views tables are not included in this list.

Returns
array

Definition at line 147 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getCurrentMaxLangId ( )

Get max language ID used in shop. For checking is used table "oxarticle" field "oxtitle"

Returns
int

Definition at line 301 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getFields (   $sTableName)

Get table fields

Parameters
string$sTableNametable name
Returns
array

Definition at line 49 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getIndices (   $tableName)

Get the indices of a table

Parameters
string$tableNameThe name of the table for which we want the
Returns
array The indices of the given table

Definition at line 108 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getMultilangFields (   $sTable)

Get table multi-language fields

Parameters
string$sTabletable name
Returns
array

Definition at line 338 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getNextLangId ( )

Get next available language ID

Returns
int

Definition at line 326 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::getSinglelangFields (   $sTable,
  $iLang 
)

Get single language fields

Parameters
string$sTabletable name
int$iLanglanguage id
Returns
array

Definition at line 360 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::hasIndex (   $indexName,
  $tableName 
)

Check, if the table has an index with the given name

Parameters
string$indexNameThe name of the index we want to check
string$tableNameThe table to check for the index
Returns
bool Has the table the given index?

Definition at line 127 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::resetLanguage (   $iLangId)

Resetting all multi-language fields with specific language id to default value in all tables. Only if language ID > 0.

Parameters
int$iLangIdLanguage id
Returns
null

Definition at line 461 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::resetMultilangFields (   $iLangId,
  $sTableName 
)

Resetting all multi-language fields with specific language id to default value in selected table

Parameters
int$iLangIdLanguage id
string$sTableNameTable name
Returns
null

Definition at line 407 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::safeGuardAdditionalMultiLanguageTables ( )
protected

Ensure that all *_set* tables for all tables in config parameter 'aMultiLangTables' are created.

Returns
null

Definition at line 563 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::tableExists (   $sTableName)

Check if table exists

Parameters
string$sTableNametable name
Returns
bool

Definition at line 69 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::updateViews (   $aTables = null)

Updates all views

Parameters
array$aTablesarray of DB table name that can store different data per shop like oxArticle
Returns
bool

Definition at line 508 of file oxdbmetadatahandler.php.

Member Data Documentation

oxDbMetaDataHandler::$_aDbTablesFields = null
protected

Definition at line 14 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::$_aSkipTablesOnReset = array("oxcountry")
protected

Definition at line 33 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::$_aTables = null
protected

Definition at line 21 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::$_iCurrentMaxLangId
protected

Definition at line 27 of file oxdbmetadatahandler.php.

oxDbMetaDataHandler::$aForceOriginalFields = array('OXID')
protected

Definition at line 40 of file oxdbmetadatahandler.php.


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