Public Member Functions |
| getFields ($sTableName) |
| tableExists ($sTableName) |
| fieldExists ($sFieldName, $sTableName) |
| 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) |
| __call ($sMethod, $aArgs) |
| __construct () |
| getConfig () |
| setConfig ($oConfig) |
| getSession () |
| setSession ($oSession) |
| getUser () |
| setUser ($oUser) |
| isAdmin () |
| setAdminMode ($blAdmin) |
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 | $sTable | core table name |
string | $iLang | language id |
- Returns
- string
Definition at line 152 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::addNewLangToDb |
( |
| ) |
|
Add new language to database. Scans all tables and adds new multi-language fields
Definition at line 398 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
-
Definition at line 352 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::ensureMultiLanguageFields |
( |
|
$sTable, |
|
|
|
$iLanguageId |
|
) |
| |
|
protected |
Make sure that all *_set* tables with all required multilanguage fields are created.
- Parameters
-
- Returns
- null
Definition at line 552 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::executeSql |
( |
|
$aSql | ) |
|
oxDbMetaDataHandler::fieldExists |
( |
|
$sFieldName, |
|
|
|
$sTableName |
|
) |
| |
Check if field exists in table
- Parameters
-
string | $sFieldName | field name |
string | $sTableName | table 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
-
$fields | Language fields array we need to filter for core fields. |
- Returns
- array
Definition at line 507 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::getAddFieldIndexSql |
( |
|
$sTable, |
|
|
|
$sField, |
|
|
|
$sNewField, |
|
|
|
$sTableSet = null |
|
) |
| |
Get sql for new multi-language field index creation
- Parameters
-
string | $sTable | core table name |
string | $sField | field name |
string | $sNewField | new field name |
string | $sTableSet | table to change (if not set take core table) |
- Returns
- string
Definition at line 212 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::getAddFieldSql |
( |
|
$sTable, |
|
|
|
$sField, |
|
|
|
$sNewField, |
|
|
|
$sPrevField, |
|
|
|
$sTableSet = null |
|
) |
| |
Get sql for new multi-language field creation
- Parameters
-
string | $sTable | core table name |
string | $sField | field name |
string | $sNewField | new field name |
string | $sPrevField | previous field in table |
string | $sTableSet | table to change (if not set take core table) |
- Returns
- string
Definition at line 176 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::getAllMultiTables |
( |
|
$sTable | ) |
|
return all DB tables for the language sets
- Parameters
-
string | $sTable | table name to check |
- Returns
- array
Definition at line 130 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 107 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 261 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::getFields |
( |
|
$sTableName | ) |
|
oxDbMetaDataHandler::getMultilangFields |
( |
|
$sTable | ) |
|
oxDbMetaDataHandler::getNextLangId |
( |
| ) |
|
oxDbMetaDataHandler::getSinglelangFields |
( |
|
$sTable, |
|
|
|
$iLang |
|
) |
| |
Get single language fields
- Parameters
-
string | $sTable | table name |
int | $iLang | language id |
- Returns
- array
Definition at line 320 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
-
- Returns
- null
Definition at line 421 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 | $iLangId | Language id |
string | $sTableName | Table name |
- Returns
- null
Definition at line 367 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 523 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::tableExists |
( |
|
$sTableName | ) |
|
Check if table exists
- Parameters
-
string | $sTableName | table name |
- Returns
- bool
Definition at line 69 of file oxdbmetadatahandler.php.
oxDbMetaDataHandler::updateViews |
( |
|
$aTables = null | ) |
|
Updates all views
- Parameters
-
array | $aTables | array of DB table name that can store different data per shop like oxArticle |
- Returns
- bool
Definition at line 468 of file oxdbmetadatahandler.php.
Member Data Documentation
oxDbMetaDataHandler::$_aDbTablesFields = null |
|
protected |
oxDbMetaDataHandler::$_aSkipTablesOnReset = array("oxcountry") |
|
protected |
oxDbMetaDataHandler::$_aTables = null |
|
protected |
oxDbMetaDataHandler::$_iCurrentMaxLangId |
|
protected |
oxDbMetaDataHandler::$aForceOriginalFields = array('OXID') |
|
protected |
The documentation for this class was generated from the following file: