Public Member Functions | Protected Member Functions | Protected Attributes

oxI18n Class Reference

Inheritance diagram for oxI18n:
Collaboration diagram for oxI18n:

List of all members.

Public Member Functions

 __construct ()
 setLanguage ($iLang=null)
 getLanguage ()
 setEnableMultilang ($blEmployMultilanguage)
 isMultilingualField ($sFieldName)
 isMultilang ()
 loadInLang ($iLanguage, $sOxid)
 modifyCacheKey ($sCacheKey, $blOverride=false)
 getAvailableInLangs ()
 getUpdateSqlFieldName ($sField)
 getViewName ($blForceCoreTableUsage=null)

Protected Member Functions

 _getFieldStatus ($sFieldName)
 _getNonCachedFieldNames ($blForceFullStructure=false)
 _getFieldLang ($sFieldName)
 _getUpdateFieldsForTable ($sTable, $blUseSkipSaveFields=true)
 _getUpdateFields ($blUseSkipSaveFields=true)
 _update ()
 _getLanguageSetTables ()
 _insert ()
 _getObjectViewName ($sTable, $sShopID=null)
 _getAllFields ($blReturnSimple=false)
 _addField ($sName, $sStatus, $sType=null, $sLength=null)
 _canFieldBeNull ($sFieldName)

Protected Attributes

 $_sClassName = 'oxI18n'
 $_iLanguage = null
 $_blEmployMultilanguage = true

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 oxActions, oxAttribute, oxCountry, oxDelivery, oxDeliverySet, oxDiscount, oxGroups, oxLinks, oxMediaUrl, oxNews, oxPayment, oxShop, oxState, and oxWrapping.

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 $sName Field name
string $sStatus Field status (0-non multilang field, 1-multilang field)
string $sType Field type
string $sLength Field Length
Returns:
null;

Reimplemented from oxBase.

Definition at line 565 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 $sFieldName db field name
Returns:
bool

Reimplemented from oxBase.

Definition at line 585 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 $blReturnSimple Set $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 542 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 $sFieldName Field name
Returns:
bool

Definition at line 303 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 $sFieldName Field name
Returns:
int

Reimplemented from oxBase.

Definition at line 245 of file oxi18n.php.

oxI18n._getLanguageSetTables (  )  [protected]

return all DB tables for the language sets

Returns:
array

Definition at line 457 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 $blForceFullStructure Whether to force loading of full data structure
Returns:
array

Reimplemented from oxBase.

Definition at line 265 of file oxi18n.php.

oxI18n._getObjectViewName ( sTable,
sShopID = null 
) [protected]

Returns actual object view or table name

Parameters:
string $sTable Original table name
int $sShopID Shop ID
Returns:
string

Reimplemented from oxBase.

Definition at line 492 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 $blUseSkipSaveFields forces usage of skip save fields array (default is true)
Returns:
string

Reimplemented from oxBase.

Definition at line 403 of file oxi18n.php.

oxI18n._getUpdateFieldsForTable ( sTable,
blUseSkipSaveFields = true 
) [protected]

return update fields SQL part

Parameters:
string $sTable table name to be updated
bool $blUseSkipSaveFields use skip save fields array?
Returns:
string

Definition at line 340 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 oxNews.

Definition at line 469 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:
oxObjectException Throws on failure inserting
Returns:
bool

Reimplemented from oxBase.

Reimplemented in oxNews.

Definition at line 418 of file oxi18n.php.

oxI18n.getAvailableInLangs (  ) 

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

Returns:
array

Definition at line 179 of file oxi18n.php.

oxI18n.getLanguage (  ) 

Returns object language

Returns:
int

Definition at line 69 of file oxi18n.php.

oxI18n.getUpdateSqlFieldName ( sField  ) 

Returns DB field name for update.

Parameters:
string $sField Field name
Returns:
string

Definition at line 322 of file oxi18n.php.

oxI18n.getViewName ( blForceCoreTableUsage = null  ) 

Returns main table data is actually selected from (could be a view name as well)

Parameters:
bool $blForceCoreTableUsage (optional) use core views
Returns:
string

Reimplemented from oxBase.

Definition at line 511 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 130 of file oxi18n.php.

oxI18n.isMultilingualField ( sFieldName  ) 

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

Parameters:
string $sFieldName Field name
Returns:
bool

Definition at line 109 of file oxi18n.php.

oxI18n.loadInLang ( iLanguage,
sOxid 
)

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

Parameters:
integer $iLanguage Load this language compatible data
string $sOxid object ID
Returns:
bool

Definition at line 143 of file oxi18n.php.

oxI18n.modifyCacheKey ( sCacheKey,
blOverride = false 
)

Lazy loading cache key modifier.

Parameters:
string $sCacheKey kache key
bool $blOverride marker to force override cache key
Returns:
null;

Reimplemented from oxBase.

Definition at line 160 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 $blEmployMultilanguage New $this->_blEmployMultilanguage value
Returns:
null;

Definition at line 85 of file oxi18n.php.

oxI18n.setLanguage ( iLang = null  ) 

Sets object language.

Parameters:
string $iLang string (default null)
Returns:
null;

Definition at line 57 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]

Reimplemented from oxBase.

Reimplemented in oxActions, oxAttribute, oxCountry, oxDelivery, oxDeliverySet, oxDiscount, oxGroups, oxLinks, oxMediaUrl, oxNews, oxPayment, oxShop, oxState, and oxWrapping.

Definition at line 18 of file oxi18n.php.


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