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)
 delete ($sOXID=null)

Protected Member Functions

 _getFieldStatus ($sFieldName)
 _getNonCachedFieldNames ($blForceFullStructure=false)
 _getFieldLang ($sFieldName)
 _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 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 539 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 559 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 515 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 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 $sFieldName Field 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 $sCoreTableName core table name [optional]
Returns:
array

Definition at line 458 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 264 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 495 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 402 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 339 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 472 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 in oxNews.

Definition at line 417 of file oxi18n.php.

oxI18n.delete ( sOXID = null  ) 

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

Parameters:
string $sOXID Object ID(default null)
Returns:
bool

Reimplemented from oxBase.

Reimplemented in oxActions, oxAttribute, oxDelivery, oxDeliverySet, oxDiscount, oxGroups, oxMediaUrl, oxNews, and oxPayment.

Definition at line 573 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 $sField Field 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 $sFieldName Field name
Returns:
bool

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 $iLanguage Load this language compatible data
string $sOxid object ID
Returns:
bool

Definition at line 141 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

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 $blEmployMultilanguage New $this->_blEmployMultilanguage value

Definition at line 82 of file oxi18n.php.

oxI18n.setLanguage ( iLang = null  ) 

Sets object language.

Parameters:
string $iLang string (default null)

Definition at line 55 of file oxi18n.php.


Member Data Documentation

oxI18n.$_blEmployMultilanguage = true [protected]

Reimplemented from oxBase.

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: