eZPublish  4.5
eZContentLanguage Class Reference
+ Inheritance diagram for eZContentLanguage:
+ Collaboration diagram for eZContentLanguage:

Public Member Functions

 classCount ()
 
 eZContentLanguage ($row=array())
 Constructor. More...
 
 localeObject ()
 
 objectCount ()
 
 objectInitialCount ()
 
 removeThis ()
 Removes the language if there is no object having translation in it. More...
 
 translation ()
 
 updateObjectNames ()
 
- Public Member Functions inherited from eZPersistentObject
 attribute ($attr, $noFunction=false)
 
 attributes ()
 
 eZPersistentObject ($row)
 
 fill ($row)
 
 hasAttribute ($attr)
 
 hasDirtyData ()
 
 remove ($conditions=null, $extraConditions=null)
 
 setAttribute ($attr, $val)
 
 setHasDirtyData ($hasDirtyData)
 
 store ($fieldFilters=null)
 
 sync ($fieldFilters=null)
 

Static Public Member Functions

static addLanguage ($locale, $name=null)
 Adds new language to the site. More...
 
static clearCronjobMode ()
 Switches off the cronjob mode. More...
 
static clearPrioritizedLanguages ()
 Clears the prioritized language list set by eZContentLanguage::setPrioritizedLanguages and reloading the list from INI settings. More...
 
static decodeLanguageMask ($langMask, $returnLanguageLocale=false)
 Decodes $langMask into all languages it comprises and whether or not the language mask signifies always available or not. More...
 
static definition ()
 Persistent object's definition. More...
 
static expireCache ()
 Removes all memory cache forcing it to read from database again for next method calls. More...
 
static fetch ($id)
 Fetches the language identified by ID. More...
 
static fetchByLocale ($locale, $createIfNotExist=false)
 Fetches the language identified by locale code. More...
 
static fetchLimitationList ($forceReloading=false)
 Fetches the array with names and IDs of the languages used on the site. More...
 
static fetchList ($forceReloading=false)
 Fetches the list of the languages used on the site. More...
 
static fetchLocaleList ()
 Fetches the array of locale codes of the languages used on the site. More...
 
static idByLocale ($locale)
 Returns id of the language specified. More...
 
static jsArrayByMask ($mask)
 Returns the Javascript array with locale codes and names of the languages which have set the corresponding bit in specified mask. More...
 
static languagesByMask ($mask)
 Returns array of languages which have set the corresponding bit in the mask. More...
 
static languagesSQLFilter ($languageListTable, $languageListAttributeName= 'language_mask')
 Returns the SQL where-condition for selecting the rows (objects, object versions) which exist in any of prioritized languages or are always available. More...
 
static maskByLocale ($locales, $setZerothBit=false)
 Returns bitmap mask for the specified languages. More...
 
static maskForRealLanguages ()
 
static prioritizedLanguageCodes ()
 Returns the array of the locale codes of the prioritized languages (in the correct order). More...
 
static prioritizedLanguages ($languageList=false)
 Fetches the list of the prioritized languages (in the correct order). More...
 
static prioritizedLanguagesByLocaleList ($languageLocaleList)
 Returns array of prioritized languages which are listed in $languageLocaleList. More...
 
static prioritizedLanguagesByMask ($mask)
 Returns array of prioritized languages which have set the corresponding bit in the mask. More...
 
static removeLanguage ($id)
 Removes the language specified by ID. More...
 
static setCronjobMode ($enable=true)
 Switches on the cronjob mode. More...
 
static setPrioritizedLanguages ($languages)
 Overrides the prioritized languages set by INI settings with the specified languages. More...
 
static sqlFilter ($languageTable, $languageListTable=null, $languageAttributeName= 'language_id', $languageListAttributeName= 'language_mask')
 Returns the SQL where-condition for selecting the rows (with object names, attributes etc.) in the correct language, i. More...
 
static topPriorityLanguage ()
 Returns the most prioritized language. More...
 
static topPriorityLanguageByLocaleList ($languageLocaleList)
 Returns the most prioritized language from specified by $languageLocaleList list of language locales. More...
 
static topPriorityLanguageByMask ($mask)
 Returns the most prioritized language which has set the corresponding bit in the mask. More...
 
- Static Public Member Functions inherited from eZPersistentObject
static conditionText ($conditions)
 
static conditionTextByRow ($conditions, $row)
 
static count ($def, $conds=null, $field=null)
 
static definition ()
 
static escapeArray ($array)
 
static fetchObject ($def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 
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 getShortAttributeName ($db, $def, $attrName)
 
static handleRows ($rows, $class_name, $asObject)
 
static newObjectOrder ($def, $orderField, $conditions)
 
static removeObject ($def, $conditions=null, $extraConditions=null)
 
static reorderObject ($def, $orderField, $conditions, $down=true)
 
static swapRow ($table, $keys, $order_id, $rows, $id1, $id2)
 
static updateObjectList ($parameters)
 

Public Attributes

const MAX_COUNT = 30
 
- Public Attributes inherited from eZPersistentObject
 $PersistentDataDirty
 Whether the data is dirty, ie needs to be stored, or not. More...
 

Member Function Documentation

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

Adds new language to the site.

Parameters
localeLocale code (e.g. 'slk-SK') of language to add.
nameOptional. 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::MAX_COUNT languages).

Referenced by fetchByLocale(), eZStepCreateSites\initializePackage(), eZContentObjectVersion\unserialize(), and eZContentObject\unserialize().

eZContentLanguage::classCount ( )
Returns
The count of classes containing the translation in this language.

Referenced by removeThis().

static eZContentLanguage::clearCronjobMode ( )
static

Switches off the cronjob mode.

See Also
eZContentLanguage::setCronjobMode()
static eZContentLanguage::clearPrioritizedLanguages ( )
static
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

Referenced by eZXMLTextType\onPublish().

static eZContentLanguage::definition ( )
static

Persistent object's definition.

Referenced by fetchList().

static eZContentLanguage::expireCache ( )
static

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

Referenced by eZStepCreateSites\initializePackage().

eZContentLanguage::eZContentLanguage (   $row = array())

Constructor.

Parameters
rowParameter passed to the constructor of eZPersistentObject.

Referenced by addLanguage().

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
forceReloadingOptional. 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.
static eZContentLanguage::fetchList (   $forceReloading = false)
static

Fetches the list of the languages used on the site.

Parameters
forceReloadingOptional. 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.

Referenced by addLanguage(), eZContentObjectStateGroup\allTranslations(), eZContentObjectState\allTranslations(), eZApproveType\attribute(), eZMultiplexerType\attribute(), fetch(), fetchByLocale(), fetchLimitationList(), fetchLocaleList(), languagesByMask(), maskForRealLanguages(), prioritizedLanguages(), removeThis(), eZContentObject\translationList(), and eZContentObject\translationStringList().

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.

Referenced by eZContentObject\canCreateClassList(), eZContentObjectTreeNode\canCreateClassList(), eZContentClass\canInstantiateClassList(), and eZContentObjectPackageHandler\handleParameters().

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
maskBitmap mask specifying which languages should be considered.
Returns
JavaScript array described above.

Referenced by eZContentObject\availableLanguagesJsArray(), eZContentStructureTreeOperator\createContentStructureNode(), and eZContentStructureTreeOperator\initContentStructureTree().

static eZContentLanguage::languagesByMask (   $mask)
static

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

Parameters
maskBitmap specifying which languages should be returned.
Returns
Array of eZContentLanguage objects of languages which have set the corresponding bit in $mask.

Referenced by eZContentObject\allLanguages(), eZApproveType\attributeDecoder(), eZMultiplexerType\attributeDecoder(), and eZContentOperationCollection\copyTranslations().

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
languageListTableName of the table
languageListAttributeNameOptional. Name of the attribute in the table which contains the bitmap mask. 'language_mask' by default.
Returns
SQL where-condition described above.

Referenced by eZURLAliasML\fetchByAction(), eZContentObjectStateGroup\fetchByConditions(), eZContentObjectState\fetchByConditions(), eZURLAliasML\fetchByParentID(), eZURLAliasML\fetchByPath(), eZContentObjectTreeNode\fetchNode(), eZURLAliasML\fetchPathByActionList(), eZURLAliasQuery\generateSQL(), eZURLAliasML\getPath(), eZURLAliasML\reverseTranslate(), eZSearchEngine\search(), eZContentObjectTreeNode\subTreeByNodeID(), eZContentObjectTreeNode\subTreeMultiPaths(), eZURLAliasML\translate(), and eZContentObjectTrashNode\trashList().

eZContentLanguage::localeObject ( )
Returns
Locale object for this language.
static eZContentLanguage::maskByLocale (   $locales,
  $setZerothBit = false 
)
static

Returns bitmap mask for the specified languages.

Parameters
localesArray of strings or a string specifying locale codes of the languages, e. g. 'slk-SK' or array( 'eng-GB', 'nor-NO' )
setZerothBitOptional. 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.

Referenced by eZContentObjectVersion\checkAccess(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZURLAliasML\fetchByAction(), eZContentOperationCollection\setObjectStatusPublished(), and eZContentObjectVersion\updateLanguageMask().

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.)

Referenced by eZContentObject\removeTranslation().

eZContentLanguage::objectCount ( )
Returns
The count of objects containing the translation in this language.

Referenced by removeThis().

eZContentLanguage::objectInitialCount ( )
Returns
The count of objects having this language as the initial/main one.
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()

Referenced by eZContentClass\canInstantiateLanguages(), eZContentFunctionCollection\fetchPrioritizedLanguageCodes(), and ezpLanguageSwitcherFunctionCollection\fetchUrlAlias().

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
languageLocaleListList of language locales to choose from.
Returns
Array of eZContentLanguage objects of prioritized languages which have set the corresponding bit in $mask.

Referenced by eZSerializedObjectNameList\prioritizedLanguages().

static eZContentLanguage::prioritizedLanguagesByMask (   $mask)
static

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

Parameters
maskBitmap specifying which languages should be returned.
Returns
Array of eZContentLanguage objects of prioritized languages which have set the corresponding bit in $mask.

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

static eZContentLanguage::removeLanguage (   $id)
static

Removes the language specified by ID.

Parameters
idID of the language to be removed.
Returns
True if the language was removed from the site, false otherwise.
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.
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
enableOptional. If false, it will switch off the cronjob mode. True by default.

Referenced by clearCronjobMode().

static eZContentLanguage::setPrioritizedLanguages (   $languages)
static

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

Parameters
languagesLocale codes of the languages which will override the prioritized languages (the order is relevant).

Referenced by clearPrioritizedLanguages(), eZURLAliasML\getPath(), eZStepCreateSites\initializePackage(), eZContentObjectTreeNode\subTreeByNodeID(), eZContentObjectTreeNode\subTreeCountByNodeID(), and eZContentObjectTreeNode\subTreeMultiPaths().

static eZContentLanguage::sqlFilter (   $languageTable,
  $languageListTable = null,
  $languageAttributeName = 'language_id',
  $languageListAttributeName = 'language_mask' 
)
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
languageTableName of the table containing the attribute with the language id.
languageListTableName of the table containing the attribute with the available languages bitmap.
languageAttributeNameOptional. Name of the attribute in $languageTable which contains the language id. 'language_id' by default.
languageListAttributeNameOptional. Name of the attribute in $languageListTable which contains the bitmap mask. 'language_mask' by default.
Returns
SQL where-condition described above.

Referenced by eZContentObjectTreeNode\createAttributeFilterSQLStrings(), eZContentObjectTreeNode\createSortingSQLStrings(), eZContentObjectTreeNode\createVersionNameJoinsSQLString(), eZContentObjectTreeNode\fetch(), eZContentObjectVersion\fetchAttributes(), eZContentObject\fetchAttributesByIdentifier(), eZContentObjectStateGroup\fetchByConditions(), eZContentObjectState\fetchByConditions(), eZContentObject\fetchByNodeID(), eZContentObject\fetchIDArray(), eZContentObject\relatedObjects(), eZSearchEngine\search(), eZContentClassName\sqlAppendFilter(), and eZContentClassName\sqlFilter().

static eZContentLanguage::topPriorityLanguage ( )
static

Returns the most prioritized language.

Returns
eZContentLanguage object for the most prioritized language.

Referenced by decodeLanguageMask(), eZSerializedObjectNameList\defaultLanguage(), eZContentObject\defaultLanguage(), and eZURLAliasML\storePath().

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
languageLocaleListList of language locales to choose from.
Returns
eZContentLanguage object of the most prioritized language.

Referenced by eZSerializedObjectNameList\topPriorityLanguage().

static eZContentLanguage::topPriorityLanguageByMask (   $mask)
static

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

Parameters
maskBitmap specifying which languages should be checked.
Returns
eZContentLanguage object of the most prioritized language which have set the corresponding bit in $mask.

Referenced by eZContentObject\eZContentObject().

eZContentLanguage::translation ( )
Returns
Reference to itself. Kept because of the backward compatibility.
eZContentLanguage::updateObjectNames ( )

Member Data Documentation

const eZContentLanguage::MAX_COUNT = 30

Referenced by addLanguage(), and decodeLanguageMask().


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