Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZContentLanguage Class Reference
Inheritance diagram for eZContentLanguage:

## Public Member Functions
| removeThis ()
| localeObject ()
| objectCount ()
| classCount ()
| objectInitialCount ()
| translation ()
Public Member Functions inherited from eZPersistentObject
| __construct ( $row=null)
| eZPersistentObject ( $row=null)
| fill ( $row)
| remove ( $conditions=null, $extraConditions=null)
| store ( $fieldFilters=null)
| sync ( $fieldFilters=null)
| attributes ()
| hasAttribute ( $attr)
| attribute ( $attr, $noFunction=false)
| setAttribute ( $attr, $val)
| hasDirtyData ()
| setHasDirtyData ( $hasDirtyData)

## Static Public Member Functions
static | definition ()
static | addLanguage ( $locale, $name=null)
static | removeLanguage ( $id)
static | fetchList ( $forceReloading=false)
static | fetchLimitationList ( $forceReloading=false)
static | fetchLocaleList ()
static | fetch ( $id)
static | fetchByLocale ( $locale, $createIfNotExist=false)
static | prioritizedLanguages ( $languageList=false)
static | prioritizedLanguageCodes ()
static | setPrioritizedLanguages ( $languages)
static | clearPrioritizedLanguages ()
static | topPriorityLanguage ()
static | languagesByMask ( $mask)
static | prioritizedLanguagesByMask ( $mask)
static | prioritizedLanguagesByLocaleList ( $languageLocaleList)
static | topPriorityLanguageByMask ( $mask)
static | topPriorityLanguageByLocaleList ( $languageLocaleList)
static | maskByLocale ( $locales, $setZerothBit=false)
static | decodeLanguageMask ( $langMask, $returnLanguageLocale=false)
static | idByLocale ( $locale)
static | languagesSQLFilter ( $languageListTable, $languageListAttributeName='language_mask')
static | sqlFilter ( $languageTable, $languageListTable=null, $languageAttributeName='language_id', $languageListAttributeName='language_mask', $lang=false)
static | setCronjobMode ( $enable=true)
static | clearCronjobMode ()
static | jsArrayByMask ( $mask)
static | maskForRealLanguages ()
static | expireCache ( $expireCluster=true)
static | maxCount ()
Static Public Member Functions inherited from eZPersistentObject
static | replaceFieldsWithShortNames (eZDBInterface $db, array $fieldDefs, &$fields)
static | count ( $def, $conds=null, $field=null)
static | fetchObject ( $def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
static | removeObject ( $def, $conditions=null, $extraConditions=null)
static | storeObject ( $obj, $fieldFilters=null)
static | conditionText ( $conditions)
static | conditionTextByRow ( $conditions, $row)
static | fetchObjectList ( $def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
static | handleRows ( $rows, $class_name, $asObject)
static | swapRow ( $table, $keys, $order_id, $rows, $id1, $id2)
static | newObjectOrder ( $def, $orderField, $conditions)
static | reorderObject ( $def, $orderField, $conditions, $down=true)
static | escapeArray ( $array)
static | updateObjectList ( $parameters)
static | getShortAttributeName ( $db, $def, $attrName)

## Public Attributes
| $ID
| $Name
| $Locale
| $Disabled
Public Attributes inherited from eZPersistentObject
| $PersistentDataDirty
| $ID
| $ContentObjectID
| $SectionID
| $OwnerID
| $ClassID
| $Published
| $Modified
| $CurrentVersion
| $Status
| $RemoteID
| $LanguageMask
| $InitialLanguageID
| $NodeID
| $ParentNodeID
| $MainNodeID
| $ContentObjectVersion
| $ContentObjectIsPublished
| $Depth
| $SortField
| $SortOrder
| $Priority
| $ModifiedSubNode
| $PathString
| $PathIdentificationString
| $IsHidden
| $IsInvisible
| $UserID
| $Name
| $Locale
| $Identifier
| $NavigationPartIdentifier
| $SerializedDescriptionList
| $URLAliasName
| $AlwaysAvailable
| $CanTranslate
| $DataInt1
| $DataInt2
| $DataInt3
| $DataInt4
| $DataFloat1
| $DataFloat2
| $DataFloat3
| $DataFloat4
| $DataText1
| $DataText2
| $DataText3
| $DataText4
| $DataText5
| $SerializedDataText
| $Category
| $PolicyID
| $Values
| $Created
| $CurrencyCode
| $ProductCollectionID
| $ItemCount
| $Price
| $IsVATIncluded
| $VATValue
| $DiscountValue
| $Email
| $IsTemporary
| $IsArchived
| $IsActive
| $OrderID
| $ModifierID
| $Code
| $Symbol
| $AutoRateValue
| $CustomRateValue
| $RateFactor
| $Main
| $MementoKey
| $MainKey
| $WorkflowEventPos
| $LanguageID
| $ContentObjectStateGroupID
| $contentobject_attribute_id
| $contentobject_id
| $rating
| $rating_count
| $rating_average

## Additional Inherited Members
Static Protected Member Functions inherited from eZPersistentObject
static | replaceFieldsWithLongNames (eZDBInterface $db, array $fieldDefs, &$fields)

## Detailed Description

Definition at line 12 of file ezcontentlanguage.php.

## Member Function Documentation

## ◆ addLanguage()

static eZContentLanguage::addLanguage | ( |  | $locale,
|  |  | $name = `null`
| ) |  |
| static

Adds new language to the site.

Parameters

  locale | Locale code (e.g. 'slk-SK') of language to add.
  name | Optional. Name of the language. If not specified, the international language name for the $locale locale will be used.

Returns
  eZContentLanguage object of the added language (or the existing one if specified language has been already used) or false in case of any error (invalid locale code or already reached eZContentLanguage::maxCount() languages).

Definition at line 53 of file ezcontentlanguage.php.

References $db, $language, $locale, $name, eZPersistentObject\count(), fetchByLocale(), fetchList(), eZDebug\writeError(), and eZDebug\writeWarning().

Referenced by fetchByLocale().

## ◆ classCount()

eZContentLanguage::classCount | ( |  | ) |

Returns
  The count of classes containing the translation in this language.

Definition at line 807 of file ezcontentlanguage.php.

References $count, $db, and $ID.

Referenced by removeThis().

## ◆ clearCronjobMode()

static eZContentLanguage::clearCronjobMode | ( |  | ) |
| static

Switches off the cronjob mode.

See also
  eZContentLanguage::setCronjobMode()

Definition at line 867 of file ezcontentlanguage.php.

References setCronjobMode().

## ◆ clearPrioritizedLanguages()

static eZContentLanguage::clearPrioritizedLanguages | ( |  | ) |
| static

Clears the prioritized language list set by eZContentLanguage::setPrioritizedLanguages and reloading the list from INI settings.

Definition at line 394 of file ezcontentlanguage.php.

References setPrioritizedLanguages().

Referenced by ezpLanguageSwitcher\destinationUrl().

## ◆ decodeLanguageMask()

static eZContentLanguage::decodeLanguageMask | ( |  | $langMask,
|  |  | $returnLanguageLocale = `false`
| ) |  |
| static

Decodes $langMask into all languages it comprises and whether or not the language mask signifies always available or not.

The constituent languages are returned as an array of language ids. If the second parameter, $returnLanguageLocale is set to TRUE, locale-codes are used instead of language ids.

Parameters

  int | $langMask |
  boolean | $returnLanguageLocale |

Returns
  array

Definition at line 589 of file ezcontentlanguage.php.

References $i, fetch(), maxCount(), and topPriorityLanguage().

## ◆ definition()

static eZContentLanguage::definition | ( |  | ) |
| static

Persistent object's definition.

Reimplemented from eZPersistentObject.

Definition at line 17 of file ezcontentlanguage.php.

Referenced by fetchList().

## ◆ expireCache()

static eZContentLanguage::expireCache | ( |  | $expireCluster = `true` | ) |
| static

Removes all caches forcing it to read from database again for next method calls.

Parameters

  bool | $expireCluster | whether expire cluster or not.

Definition at line 917 of file ezcontentlanguage.php.

References eZSys\cacheDirectory(), and eZClusterFileHandler\instance().

Referenced by eZSiteAccess\change().

## ◆ fetch()

static eZContentLanguage::fetch | ( |  | $id | ) |
| static

Fetches the language identified by ID.

Parameters

  id | Identifier of the language to fetch.

Returns
  eZContentLanguage object of language identified by ID $id.

Definition at line 252 of file ezcontentlanguage.php.

References $id, and fetchList().

Referenced by decodeLanguageMask(), eZContentObjectState\defaultLanguage(), eZContentObjectStateGroup\defaultLanguage(), eZContentObjectStateGroupLanguage\language(), eZContentObjectStateLanguage\language(), and removeLanguage().

## ◆ fetchByLocale()

static eZContentLanguage::fetchByLocale | ( |  | $locale,
|  |  | $createIfNotExist = `false`
| ) |  |
| static

Fetches the language identified by locale code.

Parameters

  locale | Locale of the language to fetch, e. g. 'slk-SK'.

Returns
  eZContentLanguage object identified by locale code $locale.

Definition at line 265 of file ezcontentlanguage.php.

References $language, $locale, addLanguage(), and fetchList().

Referenced by addLanguage(), idByLocale(), maskByLocale(), prioritizedLanguages(), eZContentObjectState\setCurrentLanguage(), eZContentObjectStateGroup\setCurrentLanguage(), and sqlFilter().

## ◆ fetchLimitationList()

static eZContentLanguage::fetchLimitationList | ( |  | $forceReloading = `false` | ) |
| static

Fetches the array with names and IDs of the languages used on the site. This method is used by the permission system.

Parameters

  forceReloading | Optional. If true, the list will be fetched from database even if it is cached in memory. Default value is false.

Returns
  Array with names and IDs of the languages used on the site.

Definition at line 215 of file ezcontentlanguage.php.

References $language, and fetchList().

## ◆ fetchList()

static eZContentLanguage::fetchList | ( |  | $forceReloading = `false` | ) |
| static

Fetches the list of the languages used on the site.

Parameters

  forceReloading | Optional. If true, the list will be fetched from database even if it is cached in memory. Default value is false.

Returns
  Array of the eZContentLanguage objects of languages used on the site.

Definition at line 164 of file ezcontentlanguage.php.

References $language, eZSys\cacheDirectory(), definition(), eZPersistentObject\fetchObjectList(), eZClusterFileHandler\instance(), and eZDebug\writeError().

Referenced by addLanguage(), eZContentObjectState\allTranslations(), eZContentObjectStateGroup\allTranslations(), fetch(), fetchByLocale(), fetchLimitationList(), fetchLocaleList(), languagesByMask(), maskForRealLanguages(), prioritizedLanguages(), and removeThis().

## ◆ fetchLocaleList()

static eZContentLanguage::fetchLocaleList | ( |  | ) |
| static

Fetches the array of locale codes of the languages used on the site.

Returns
  Array of locale codes of the languages used on the site.

Definition at line 232 of file ezcontentlanguage.php.

References $language, and fetchList().

## ◆ idByLocale()

static eZContentLanguage::idByLocale | ( |  | $locale | ) |
| static

Returns id of the language specified.

Parameters

  locale | String specifying locale code of the language, e. g. 'slk-SK'

Returns
  ID of the language specified by locale or false if the language is not set on the site.

Definition at line 638 of file ezcontentlanguage.php.

References $language, $locale, and fetchByLocale().

Referenced by eZContentObjectState\translationByLocale(), and eZContentObjectStateGroup\translationByLocale().

## ◆ jsArrayByMask()

static eZContentLanguage::jsArrayByMask | ( |  | $mask | ) |
| static

Returns the Javascript array with locale codes and names of the languages which have set the corresponding bit in specified mask.

Parameters

  mask | Bitmap mask specifying which languages should be considered.

Returns
  JavaScript array described above.

Definition at line 879 of file ezcontentlanguage.php.

References $language, and prioritizedLanguagesByMask().

## ◆ languagesByMask()

static eZContentLanguage::languagesByMask | ( |  | $mask | ) |
| static

Returns array of languages which have set the corresponding bit in the mask.

Parameters

  mask | Bitmap specifying which languages should be returned.

Returns
  Array of eZContentLanguage objects of languages which have set the corresponding bit in $mask.

Definition at line 433 of file ezcontentlanguage.php.

References $language, $result, and fetchList().

## ◆ languagesSQLFilter()

static eZContentLanguage::languagesSQLFilter | ( |  | $languageListTable,
|  |  | $languageListAttributeName = `'language_mask'`
| ) |  |
| static

Returns the SQL where-condition for selecting the rows (objects, object versions) which exist in any of prioritized languages or are always available.

Parameters

  languageListTable | Name of the table
  languageListAttributeName | Optional. Name of the attribute in the table which contains the bitmap mask. 'language_mask' by default.

Returns
  SQL where-condition described above.

Definition at line 660 of file ezcontentlanguage.php.

References $db, $language, and prioritizedLanguages().

Referenced by eZContentObjectState\fetchByConditions(), and eZContentObjectStateGroup\fetchByConditions().

## ◆ localeObject()

eZContentLanguage::localeObject | ( |  | ) |

Returns
  Locale object for this language.

Definition at line 421 of file ezcontentlanguage.php.

References $locale.

## ◆ maskByLocale()

static eZContentLanguage::maskByLocale | ( |  | $locales,
|  |  | $setZerothBit = `false`
| ) |  |
| static

Returns bitmap mask for the specified languages.

Parameters

  locales | Array of strings or a string specifying locale codes of the languages, e. g. 'slk-SK' or array( 'eng-GB', 'nor-NO' )
  setZerothBit | Optional. Specifies if the 0-th bit of mask should be set. False by default.

Returns
  Bitmap mask having set the corresponding bits for the specified languages.

Definition at line 547 of file ezcontentlanguage.php.

References $language, $locale, and fetchByLocale().

## ◆ maskForRealLanguages()

static eZContentLanguage::maskForRealLanguages | ( |  | ) |
| static

Returns
  The bitmap mask containing all languages, i. e. the sum of the IDs of all languages. (The 0-th bit is set.)

Definition at line 902 of file ezcontentlanguage.php.

References fetchList().

## ◆ maxCount()

static eZContentLanguage::maxCount | ( |  | ) |
| static

Returns the maximum number of languages supported.

On 64-bit platforms we support more languages. PHP uses signed integers, and the first bit is reserved for the "always available" flag, so we can use 62 bits on 64 bits hardware, or 30 on 32-bit. The database uses a 64-bit integer on all platforms.

Definition at line 941 of file ezcontentlanguage.php.

Referenced by decodeLanguageMask().

## ◆ objectCount()

eZContentLanguage::objectCount | ( |  | ) |

Returns
  The count of objects containing the translation in this language.

Definition at line 786 of file ezcontentlanguage.php.

References $count, $db, and $ID.

Referenced by removeThis().

## ◆ objectInitialCount()

eZContentLanguage::objectInitialCount | ( |  | ) |

Returns
  The count of objects having this language as the initial/main one.

Definition at line 831 of file ezcontentlanguage.php.

References $count, $db, and $ID.

## ◆ prioritizedLanguageCodes()

static eZContentLanguage::prioritizedLanguageCodes | ( |  | ) |
| static

Returns the array of the locale codes of the prioritized languages (in the correct order).

Returns
  Array of the locale codes of the prioritized languages (in the correct order).

See also
  eZContentLanguage::prioritizedLanguages()

Definition at line 362 of file ezcontentlanguage.php.

References $language, and prioritizedLanguages().

Referenced by ezpLanguageSwitcherFunctionCollection\fetchUrlAlias().

## ◆ prioritizedLanguages()

static eZContentLanguage::prioritizedLanguages | ( |  | $languageList = `false` | ) |
| static

Fetches the list of the prioritized languages (in the correct order).

Parameters

  languageList | Optional. If specified, this array of locale codes with will override the INI settings. Usage of this parameter is restricted to methods of this class! See eZContentLanguage::setPrioritizedLanguages().

Returns
  Array of the eZContentLanguage objects of the prioritized languages.

Definition at line 295 of file ezcontentlanguage.php.

References $ini, $language, fetchByLocale(), fetchList(), and eZDebug\writeWarning().

Referenced by languagesSQLFilter(), prioritizedLanguageCodes(), prioritizedLanguagesByLocaleList(), prioritizedLanguagesByMask(), setPrioritizedLanguages(), sqlFilter(), topPriorityLanguage(), topPriorityLanguageByLocaleList(), and topPriorityLanguageByMask().

## ◆ prioritizedLanguagesByLocaleList()

static eZContentLanguage::prioritizedLanguagesByLocaleList | ( |  | $languageLocaleList | ) |
| static

Returns array of prioritized languages which are listed in $languageLocaleList. The function does the same as 'prioritizedLanguagesByMask' but uses language locale list instead of language mask.

Parameters

  languageLocaleList | List of language locales to choose from.

Returns
  Array of eZContentLanguage objects of prioritized languages which have set the corresponding bit in $mask.

Definition at line 478 of file ezcontentlanguage.php.

References $language, $result, eZPersistentObject\count(), and prioritizedLanguages().

## ◆ prioritizedLanguagesByMask()

static eZContentLanguage::prioritizedLanguagesByMask | ( |  | $mask | ) |
| static

Returns array of prioritized languages which have set the corresponding bit in the mask.

Parameters

  mask | Bitmap specifying which languages should be returned.

Returns
  Array of eZContentLanguage objects of prioritized languages which have set the corresponding bit in $mask.

Definition at line 455 of file ezcontentlanguage.php.

References $language, $result, and prioritizedLanguages().

Referenced by jsArrayByMask(), eZContentObjectState\languages(), and eZContentObjectStateGroup\languages().

## ◆ removeLanguage()

static eZContentLanguage::removeLanguage | ( |  | $id | ) |
| static

Removes the language specified by ID.

Parameters

  id | ID of the language to be removed.

Returns
  True if the language was removed from the site, false otherwise.

Definition at line 122 of file ezcontentlanguage.php.

References $id, $language, and fetch().

## ◆ removeThis()

eZContentLanguage::removeThis | ( |  | ) |

Removes the language if there is no object having translation in it.

Returns
  True if the language was removed from the site, false otherwise.

Definition at line 140 of file ezcontentlanguage.php.

References classCount(), fetchList(), and objectCount().

## ◆ setCronjobMode()

static eZContentLanguage::setCronjobMode | ( |  | $enable = `true` | ) |
| static

Switches on the cronjob mode. In this mode, the languages which are not in the list of the prioritized languages will be automatically added to it.

Parameters

  enable | Optional. If false, it will switch off the cronjob mode. True by default.

Definition at line 856 of file ezcontentlanguage.php.

Referenced by clearCronjobMode().

## ◆ setPrioritizedLanguages()

static eZContentLanguage::setPrioritizedLanguages | ( |  | $languages | ) |
| static

Overrides the prioritized languages set by INI settings with the specified languages.

Parameters

  languages | Locale codes of the languages which will override the prioritized languages (the order is relevant).

Definition at line 382 of file ezcontentlanguage.php.

References prioritizedLanguages().

Referenced by clearPrioritizedLanguages(), and ezpLanguageSwitcher\destinationUrl().

## ◆ sqlFilter()

static eZContentLanguage::sqlFilter | ( |  | $languageTable,
|  |  | $languageListTable = `null`,
|  |  | $languageAttributeName = `'language_id'`,
|  |  | $languageListAttributeName = `'language_mask'`,
|  |  | $lang = `false`
| ) |  |
| static

Returns the SQL where-condition for selecting the rows (with object names, attributes etc.) in the correct language, i. e. in the most prioritized language from those in which an object exists.

Parameters

  string | $languageTable | Name of the table containing the attribute with the language id.
  string | $languageListTable | Name of the table containing the attribute with the available languages bitmap.
  string | $languageAttributeName | Optional. Name of the attribute in $languageTable which contains the language id. 'language_id' by default.
  string | $languageListAttributeName | Optional. Name of the attribute in $languageListTable which contains the bitmap mask. 'language_mask' by default.
  string | $lang | Language code of the most prioritized language

Returns
  string

Definition at line 693 of file ezcontentlanguage.php.

References $db, $id, $index, $lang, eZPersistentObject\count(), fetchByLocale(), and prioritizedLanguages().

Referenced by eZContentObjectState\fetchByConditions(), and eZContentObjectStateGroup\fetchByConditions().

## ◆ topPriorityLanguage()

static eZContentLanguage::topPriorityLanguage | ( |  | ) |
| static

Returns the most prioritized language.

Returns
  eZContentLanguage object for the most prioritized language.

Definition at line 405 of file ezcontentlanguage.php.

References prioritizedLanguages().

Referenced by decodeLanguageMask().

## ◆ topPriorityLanguageByLocaleList()

static eZContentLanguage::topPriorityLanguageByLocaleList | ( |  | $languageLocaleList | ) |
| static

Returns the most prioritized language from specified by $languageLocaleList list of language locales. The function does the same as 'topPriorityLanguageByMask' but uses language locale list instead of language mask.

Parameters

  languageLocaleList | List of language locales to choose from.

Returns
  eZContentLanguage object of the most prioritized language.

Definition at line 523 of file ezcontentlanguage.php.

References $language, eZPersistentObject\count(), and prioritizedLanguages().

## ◆ topPriorityLanguageByMask()

static eZContentLanguage::topPriorityLanguageByMask | ( |  | $mask | ) |
| static

Returns the most prioritized language which has set the corresponding bit in the mask.

Parameters

  mask | Bitmap specifying which languages should be checked.

Returns
  eZContentLanguage object of the most prioritized language which have set the corresponding bit in $mask.

Definition at line 503 of file ezcontentlanguage.php.

References $language, and prioritizedLanguages().

## ◆ translation()

eZContentLanguage::translation | ( |  | ) |

Returns
  Reference to itself. Kept because of the backward compatibility.

Definition at line 845 of file ezcontentlanguage.php.

## Member Data Documentation

## ◆ $Disabled

eZContentLanguage::$Disabled

Definition at line 949 of file ezcontentlanguage.php.

## ◆ $ID

eZContentLanguage::$ID

Definition at line 946 of file ezcontentlanguage.php.

Referenced by classCount(), objectCount(), and objectInitialCount().

## ◆ $Locale

eZContentLanguage::$Locale

Definition at line 948 of file ezcontentlanguage.php.

## ◆ $Name

eZContentLanguage::$Name

Definition at line 947 of file ezcontentlanguage.php.

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

- ezcontentlanguage.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.