OXID eShop CE  4.9.6
 All Classes Files Functions Variables Pages
oxI18n Class Reference
+ Inheritance diagram for oxI18n:
+ Collaboration diagram for oxI18n:

Public Member Functions

 __construct ()
 setLanguage ($iLang=null)
 getLanguage ()
 setEnableMultilang ($blEmployMultilanguage)
 isMultilingualField ($sFieldName)
 isMultilang ()
 loadInLang ($iLanguage, $sOxid)
 modifyCacheKey ($sCacheKey, $blOverride=false)
 getAvailableInLangs ()
 getUpdateSqlFieldName ($sField)
 delete ($sOXID=null)
- Public Member Functions inherited from oxBase
 getUseSkipSaveFields ()
 setUseSkipSaveFields ($blUseSkipSaveFields)
 __set ($sName, $sValue)
 __get ($sName)
 __isset ($mVar)
 __clone ()
 oxClone ($oObject)
 getUpdateSeo ()
 setUpdateSeo ($blUpdateSeo)
 init ($sTableName=null, $blForceAllFields=false)
 assign ($dbRecord)
 getClassName ()
 getCoreTableName ()
 getId ()
 setId ($sOXID=null)
 setShopId ($iShopId)
 getShopId ()
 getViewName ($blForceCoreTableUsage=null)
 disableLazyLoading ()
 isDerived ()
 setIsDerived ($blVal)
 load ($sOXID)
 isLoaded ()
 buildSelectString ($aWhere=null)
 assignRecord ($sSelect)
 getFieldData ($sFieldName)
 getSelectFields ($blForceCoreTableUsage=null)
 save ()
 allowDerivedUpdate ()
 allowDerivedDelete ()
 exists ($sOXID=null)
 getSqlActiveSnippet ($blForceCoreTable=null)
 beforeUpdate ($sOXID=null)
 onChange ($iAction=null, $sOXID=null)
 setInList ()
 isOx ()
 isReadOnly ()
 setReadOnly ($blReadOnly)
 getFieldNames ()
 addFieldName ($sName)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Protected Member Functions

 _getFieldStatus ($sFieldName)
 _getNonCachedFieldNames ($blForceFullStructure=false)
 _getFieldLang ($sFieldName)
 _setUpdateSeoOnFieldChange ($sField)
 _getUpdateFieldsForTable ($sTable, $blUseSkipSaveFields=true)
 _getUpdateFields ($blUseSkipSaveFields=true)
 _update ()
 _getLanguageSetTables ($sCoreTableName=null)
 _insert ()
 _getObjectViewName ($sTable, $sShopID=null)
 _getAllFields ($blReturnSimple=false)
 _addField ($sName, $sStatus, $sType=null, $sLength=null)
 _canFieldBeNull ($sFieldName)
- Protected Member Functions inherited from oxBase
 _removeElement2ShopRelations ($sOxId)
 _isInList ()
 _getTableFields ($sTable, $blReturnSimple=false)
 _initDataStructure ($blForceFullStructure=false)
 _getFieldLongName ($sFieldName)
 _setFieldData ($sFieldName, $sValue, $iDataType=oxField::T_TEXT)
 _getFieldDefaultValue ($sFieldName)
 _getUpdateFieldValue ($sFieldName, $oField)
 _isDisabledFieldCache ()
 _addSkippedSaveFieldsForMapping ()
 _disableLazyLoadingForCaching ()

Protected Attributes

 $_sClassName = 'oxI18n'
 $_iLanguage = null
 $_blEmployMultilanguage = true
- Protected Attributes inherited from oxBase
 $_sOXID = null
 $_iShopId = null
 $_blIsSimplyClonable = true
 $_sClassName = 'oxbase'
 $_sCoreTable = null
 $_sViewTable = null
 $_aFieldNames = array('oxid' => 0)
 $_sCacheKey = null
 $_blUseLazyLoading = false
 $_aSkipSaveFields = array('oxtimestamp')
 $_blUseSkipSaveFields = true
 $_sExistKey = 'oxid'
 $_blIsDerived = null
 $_blIsSeoObject = false
 $_blUpdateSeo = true
 $_blReadOnly = false
 $_blIsInList = false
 $_isLoaded = false
 $_aInnerLazyCache = null
 $_blEmployMultilanguage = false

Additional Inherited Members

- Static Protected Attributes inherited from oxBase
static $_blDisableFieldCaching = array()

Detailed Description

Class handling multilanguage data fields

Definition at line 10 of file oxi18n.php.

Constructor & Destructor Documentation

oxI18n::__construct ( )

Class constructor, initiates parent constructor (parent::oxBase()).

Reimplemented from oxBase.

Reimplemented in oxCategory, oxDelivery, oxShop, oxPayment, oxContent, oxSimpleVariant, oxManufacturer, oxVendor, oxSelectlist, oxDiscount, oxWrapping, oxAttribute, oxTagList, oxNews, oxCountry, oxLinks, oxArticleTagList, oxGroups, oxActions, oxDeliverySet, oxMediaUrl, and oxState.

Definition at line 38 of file oxi18n.php.

Member Function Documentation

oxI18n::_addField (   $sName,
  $sStatus,
  $sType = null,
  $sLength = null 
)
protected

Adds additional field to meta structure. Skips language fields

Parameters
string$sNameField name
string$sStatusField status (0-non multilang field, 1-multilang field)
string$sTypeField type
string$sLengthField Length
Returns
null;

Reimplemented from oxBase.

Definition at line 553 of file oxi18n.php.

oxI18n::_canFieldBeNull (   $sFieldName)
protected

check if db field can be null for multilingual fields it checks only the base fields as they may be coming from outer join views, so oxbase would return that they always support null (while in reality updates to their lang set table with null would fail)

Parameters
string$sFieldNamedb field name
Returns
bool

Reimplemented from oxBase.

Definition at line 573 of file oxi18n.php.

oxI18n::_getAllFields (   $blReturnSimple = false)
protected

Returns meta field or simple array of all object fields. This method is slow and normally is called before field cache is built. Make sure it is not called after first page is loaded and cache data is fully built (until tmp dir is cleaned).

Parameters
bool$blReturnSimpleSet $blReturnSimple to true when you need simple array (meta data array is returned otherwise)
See Also
oxBase::_getTableFields()
Returns
array

Reimplemented from oxBase.

Definition at line 529 of file oxi18n.php.

oxI18n::_getFieldLang (   $sFieldName)
protected

Gets multilanguage field language. In case of oxtitle_2 it will return 2. 0 is returned if language ending is not defined.

Parameters
string$sFieldNameField name
Returns
bool

Definition at line 302 of file oxi18n.php.

oxI18n::_getFieldStatus (   $sFieldName)
protected

Returns _aFieldName[] value. 0 means - non multilanguage, 1 - multilanguage field. This method is slow, so we should make sure it is called only when tmp dir is cleaned (and then the results are cached).

Parameters
string$sFieldNameField name
Returns
int

Reimplemented from oxBase.

Definition at line 243 of file oxi18n.php.

oxI18n::_getLanguageSetTables (   $sCoreTableName = null)
protected

return all DB tables for the language sets

Parameters
string$sCoreTableNamecore table name [optional]
Returns
array

Definition at line 472 of file oxi18n.php.

oxI18n::_getNonCachedFieldNames (   $blForceFullStructure = false)
protected

Returns the list of fields. This function is slower and its result is normally cached. Basically we have 3 separate cases here:

  1. We are in admin so we need extended info for all fields (name, field length and field type)
  2. Object is not lazy loaded so we will return all data fields as simple array, as we need only names
  3. Object is lazy loaded so we will return empty array as all fields are loaded on request (in __get()).
Parameters
bool$blForceFullStructureWhether to force loading of full data structure
Returns
array

Reimplemented from oxBase.

Definition at line 264 of file oxi18n.php.

oxI18n::_getObjectViewName (   $sTable,
  $sShopID = null 
)
protected

Returns actual object view or table name

Parameters
string$sTableOriginal table name
int$sShopIDShop ID
Returns
string

Reimplemented from oxBase.

Definition at line 509 of file oxi18n.php.

oxI18n::_getUpdateFields (   $blUseSkipSaveFields = true)
protected

Get object fields sql part for base table used for updates or inserts: return e.g. fldName1 = 'value1',fldName2 = 'value2'...

Parameters
bool$blUseSkipSaveFieldsforces usage of skip save fields array (default is true)
Returns
string

Reimplemented from oxBase.

Definition at line 416 of file oxi18n.php.

oxI18n::_getUpdateFieldsForTable (   $sTable,
  $blUseSkipSaveFields = true 
)
protected

return update fields SQL part

Parameters
string$sTabletable name to be updated
bool$blUseSkipSaveFieldsuse skip save fields array?
Returns
string

Definition at line 353 of file oxi18n.php.

oxI18n::_insert ( )
protected

Insert this Object into the database, this function only works on the main table, it will not save any dependend tables, which might be loaded through oxlist.

Returns
bool

Reimplemented from oxBase.

Reimplemented in oxArticle, oxCategory, and oxNews.

Definition at line 486 of file oxi18n.php.

oxI18n::_setUpdateSeoOnFieldChange (   $sField)
protected

Checks whether certain field has changed, and sets update seo flag if needed. It can only set the value to false, so it allows for multiple calls to the method, and if atleast one requires seo update, other checks won't override that. Will try to get multilang table name for relevant field check.

Parameters
string$sFieldField name that will be checked

Reimplemented from oxBase.

Definition at line 339 of file oxi18n.php.

oxI18n::_update ( )
protected

Update this Object into the database, this function only works on the main table, it will not save any dependend tables, which might be loaded through oxlist (with exception of the active language set table, which will be updated).

Exceptions
oxObjectExceptionThrows on failure inserting
Returns
bool

Reimplemented in oxArticle, oxCategory, and oxNews.

Definition at line 431 of file oxi18n.php.

oxI18n::delete (   $sOXID = null)

Delete this object from the database, returns true on success.

Parameters
string$sOXIDObject ID(default null)
Returns
bool

Reimplemented from oxBase.

Reimplemented in oxArticle, oxPayment, oxContent, oxManufacturer, oxDelivery, oxVendor, oxCategory, oxNews, oxMediaUrl, oxSelectlist, oxActions, oxDiscount, oxAttribute, oxGroups, and oxDeliverySet.

Definition at line 587 of file oxi18n.php.

oxI18n::getAvailableInLangs ( )

Returns an array of languages in which object multilanguage fields are already setted

Returns
array

Definition at line 176 of file oxi18n.php.

oxI18n::getLanguage ( )

Returns object language

Returns
int

Reimplemented from oxBase.

Definition at line 67 of file oxi18n.php.

oxI18n::getUpdateSqlFieldName (   $sField)

Returns DB field name for update.

Parameters
string$sFieldField name
Returns
string

Definition at line 321 of file oxi18n.php.

oxI18n::isMultilang ( )

Returns true, if object has multilanguage fields. In oxi18n it is always returns true.

Returns
bool

Reimplemented from oxBase.

Definition at line 128 of file oxi18n.php.

oxI18n::isMultilingualField (   $sFieldName)

Checks if this field is multlingual (returns false if language = 0)

Parameters
string$sFieldNameField name
Returns
bool

Reimplemented in oxArticle.

Definition at line 106 of file oxi18n.php.

oxI18n::loadInLang (   $iLanguage,
  $sOxid 
)

Loads object data from DB in passed language, returns true on success.

Parameters
integer$iLanguageLoad this language compatible data
string$sOxidobject ID
Returns
bool

Definition at line 141 of file oxi18n.php.

oxI18n::modifyCacheKey (   $sCacheKey,
  $blOverride = false 
)

Lazy loading cache key modifier.

Parameters
string$sCacheKeykache key
bool$blOverridemarker to force override cache key

Reimplemented from oxBase.

Definition at line 157 of file oxi18n.php.

oxI18n::setEnableMultilang (   $blEmployMultilanguage)

Object multilanguage mode setter (set true to enable multilang mode). This setter affects init() method so it should be called before init() is executed

Parameters
bool$blEmployMultilanguageNew $this->_blEmployMultilanguage value

Definition at line 82 of file oxi18n.php.

oxI18n::setLanguage (   $iLang = null)

Sets object language.

Parameters
string$iLangstring (default null)

Definition at line 55 of file oxi18n.php.

Member Data Documentation

oxI18n::$_blEmployMultilanguage = true
protected

Definition at line 33 of file oxi18n.php.

oxI18n::$_iLanguage = null
protected

Definition at line 25 of file oxi18n.php.

oxI18n::$_sClassName = 'oxI18n'
protected

Definition at line 18 of file oxi18n.php.


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