eZ Publish  [trunk]
eZContentLanguage Class Reference
+ Inheritance diagram for eZContentLanguage:
+ Collaboration diagram for eZContentLanguage:

List of all members.

Public Member Functions

 classCount ()
 eZContentLanguage ($row=array())
 Constructor.
 localeObject ()
 objectCount ()
 objectInitialCount ()
 removeThis ()
 Removes the language if there is no object having translation in it.
 translation ()
 updateObjectNames ()

Static Public Member Functions

static addLanguage ($locale, $name=null)
 Adds new language to the site.
static clearCronjobMode ()
 Switches off the cronjob mode.
static clearPrioritizedLanguages ()
 Clears the prioritized language list set by eZContentLanguage::setPrioritizedLanguages and reloading the list from INI settings.
static decodeLanguageMask ($langMask, $returnLanguageLocale=false)
 Decodes $langMask into all languages it comprises and whether or not the language mask signifies always available or not.
static definition ()
 Persistent object's definition.
static expireCache ()
 Removes all memory cache forcing it to read from database again for next method calls.
static fetch ($id)
 Fetches the language identified by ID.
static fetchByLocale ($locale, $createIfNotExist=false)
 Fetches the language identified by locale code.
static fetchLimitationList ($forceReloading=false)
 Fetches the array with names and IDs of the languages used on the site.
static fetchList ($forceReloading=false)
 Fetches the list of the languages used on the site.
static fetchLocaleList ()
 Fetches the array of locale codes of the languages used on the site.
static idByLocale ($locale)
 Returns id of the language specified.
static jsArrayByMask ($mask)
 Returns the Javascript array with locale codes and names of the languages which have set the corresponding bit in specified mask.
static languagesByMask ($mask)
 Returns array of languages which have set the corresponding bit in the mask.
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.
static maskByLocale ($locales, $setZerothBit=false)
 Returns bitmap mask for the specified languages.
static maskForRealLanguages ()
static prioritizedLanguageCodes ()
 Returns the array of the locale codes of the prioritized languages (in the correct order).
static prioritizedLanguages ($languageList=false)
 Fetches the list of the prioritized languages (in the correct order).
static prioritizedLanguagesByLocaleList ($languageLocaleList)
 Returns array of prioritized languages which are listed in $languageLocaleList.
static prioritizedLanguagesByMask ($mask)
 Returns array of prioritized languages which have set the corresponding bit in the mask.
static removeLanguage ($id)
 Removes the language specified by ID.
static setCronjobMode ($enable=true)
 Switches on the cronjob mode.
static setPrioritizedLanguages ($languages)
 Overrides the prioritized languages set by INI settings with the specified languages.
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.
static topPriorityLanguage ()
 Returns the most prioritized language.
static topPriorityLanguageByLocaleList ($languageLocaleList)
 Returns the most prioritized language from specified by $languageLocaleList list of language locales.
static topPriorityLanguageByMask ($mask)
 Returns the most prioritized language which has set the corresponding bit in the mask.

Public Attributes

const MAX_COUNT = 30

Detailed Description

Definition at line 11 of file ezcontentlanguage.php.


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

Definition at line 64 of file ezcontentlanguage.php.

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

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

Definition at line 812 of file ezcontentlanguage.php.

Referenced by removeThis().

Switches off the cronjob mode.

See also:
eZContentLanguage::setCronjobMode()

Definition at line 879 of file ezcontentlanguage.php.

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 600 of file ezcontentlanguage.php.

Referenced by eZXMLTextType\onPublish().

static eZContentLanguage::definition ( ) [static]

Persistent object's definition.

Reimplemented from eZPersistentObject.

Definition at line 28 of file ezcontentlanguage.php.

Referenced by fetchList().

static eZContentLanguage::expireCache ( ) [static]

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

Definition at line 928 of file ezcontentlanguage.php.

Referenced by eZStepCreateSites\initializePackage().

Constructor.

Parameters:
rowParameter passed to the constructor of eZPersistentObject.

Definition at line 20 of file ezcontentlanguage.php.

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.

Definition at line 226 of file ezcontentlanguage.php.

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.

Definition at line 175 of file ezcontentlanguage.php.

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

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 243 of file ezcontentlanguage.php.

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.

Definition at line 891 of file ezcontentlanguage.php.

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.

Definition at line 444 of file ezcontentlanguage.php.

Referenced by eZContentObject\allLanguages(), eZMultiplexerType\attributeDecoder(), eZApproveType\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.

Definition at line 671 of file ezcontentlanguage.php.

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

Returns:
Locale object for this language.

Definition at line 432 of file ezcontentlanguage.php.

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.

Definition at line 558 of file ezcontentlanguage.php.

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

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 914 of file ezcontentlanguage.php.

Referenced by eZContentObject\removeTranslation().

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

Definition at line 791 of file ezcontentlanguage.php.

Referenced by removeThis().

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

Definition at line 836 of file ezcontentlanguage.php.

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 373 of file ezcontentlanguage.php.

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.

Definition at line 489 of file ezcontentlanguage.php.

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.

Definition at line 466 of file ezcontentlanguage.php.

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.

Definition at line 133 of file ezcontentlanguage.php.

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 151 of file ezcontentlanguage.php.

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.

Definition at line 868 of file ezcontentlanguage.php.

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

Definition at line 393 of file ezcontentlanguage.php.

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.

Definition at line 703 of file ezcontentlanguage.php.

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

Returns the most prioritized language.

Returns:
eZContentLanguage object for the most prioritized language.

Definition at line 416 of file ezcontentlanguage.php.

Referenced by decodeLanguageMask(), 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.

Definition at line 534 of file ezcontentlanguage.php.

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.

Definition at line 514 of file ezcontentlanguage.php.

Referenced by eZContentObject\eZContentObject().

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

Definition at line 850 of file ezcontentlanguage.php.


Member Data Documentation

Definition at line 13 of file ezcontentlanguage.php.

Referenced by addLanguage(), and decodeLanguageMask().


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