eZContentLanguage Class Reference

Inheritance diagram for eZContentLanguage:
eZPersistentObject

List of all members.

Public Member Functions

classCount ()
 clearCronjobMode ()
 definition ()
 eZContentLanguage ($row=array())
 fetchByLocale ($locale, $createIfNotExist=false)
 jsArrayByMask ($mask)
 languagesByMask ($mask)
localeObject ()
 maskByLocale ($locales, $setZerothBit=false)
 maskForRealLanguages ()
objectCount ()
 objectInitialCount ()
 prioritizedLanguagesByLocaleList ($languageLocaleList)
 prioritizedLanguagesByMask ($mask)
 remove ()
 setCronjobMode ($enable=true)
 sqlFilter ($languageTable, $languageListTable=null, $languageAttributeName= 'language_id', $languageListAttributeName= 'language_mask')
 topPriorityLanguageByLocaleList ($languageLocaleList)
 topPriorityLanguageByMask ($mask)
translation ()
 updateObjectNames ()

Static Public Member Functions

 addLanguage ($locale, $name=null)
 clearPrioritizedLanguages ()
 expireCache ()
 fetch ($id)
 fetchLimitationList ($forceReloading=false)
 fetchList ($forceReloading=false)
 fetchLocaleList ()
 idByLocale ($locale)
 languagesSQLFilter ($languageListTable, $languageListAttributeName= 'language_mask')
 prioritizedLanguageCodes ()
 prioritizedLanguages ($languageList=false)
 removeLanguage ($id)
 setPrioritizedLanguages ($languages)
 topPriorityLanguage ()

Detailed Description

Definition at line 36 of file ezcontentlanguage.php.


Member Function Documentation

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

Definition at line 86 of file ezcontentlanguage.php.

Referenced by fetchByLocale(), eZContentObjectVersion::unserialize(), and eZContentObject::unserialize().

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

Definition at line 765 of file ezcontentlanguage.php.

Referenced by remove().

eZContentLanguage::clearCronjobMode (  ) 

Switches off the cronjob mode.

See also:
eZContentLanguage::setCronjobMode()

Definition at line 832 of file ezcontentlanguage.php.

eZContentLanguage::clearPrioritizedLanguages (  )  [static]

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

Definition at line 408 of file ezcontentlanguage.php.

Referenced by eZContentObjectTreeNode::subTree(), eZContentObjectTreeNode::subTreeCount(), and eZContentObjectTreeNode::subTreeMultiPaths().

eZContentLanguage::definition (  ) 

Persistent object's definition.

Reimplemented from eZPersistentObject.

Definition at line 51 of file ezcontentlanguage.php.

Referenced by fetchList().

eZContentLanguage::expireCache (  )  [static]

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

Definition at line 881 of file ezcontentlanguage.php.

eZContentLanguage::eZContentLanguage ( row = array()  ) 

Constructor.

Parameters:
row Parameter passed to the constructor of eZPersistentObject.

Definition at line 43 of file ezcontentlanguage.php.

Referenced by addLanguage().

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

Referenced by removeLanguage().

eZContentLanguage::fetchByLocale ( locale,
createIfNotExist = false 
)
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 229 of file ezcontentlanguage.php.

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

Referenced by addLanguage(), eZMultiplexerType::attribute(), eZApproveType::attribute(), fetch(), fetchByLocale(), fetchLimitationList(), fetchLocaleList(), languagesByMask(), maskForRealLanguages(), prioritizedLanguages(), and remove().

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

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

eZContentLanguage::idByLocale ( locale  )  [static]
eZContentLanguage::jsArrayByMask ( mask  ) 

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

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

eZContentLanguage::languagesByMask ( mask  ) 

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

Referenced by eZContentObject::allLanguages(), eZMultiplexerType::attributeDecoder(), and eZApproveType::attributeDecoder().

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

Referenced by eZContentObjectTreeNode::fetchNode(), eZContentObjectTreeNode::subTree(), eZContentObjectTreeNode::subTreeMultiPaths(), and eZContentObjectTrashNode::trashList().

& eZContentLanguage::localeObject (  ) 
Returns:
Locale object for this language.

Definition at line 435 of file ezcontentlanguage.php.

eZContentLanguage::maskByLocale ( locales,
setZerothBit = false 
)

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

Referenced by eZContentObjectVersion::checkAccess(), eZContentObjectTreeNode::checkAccess(), eZContentObject::checkAccess(), and eZContentObjectVersion::updateLanguageMask().

eZContentLanguage::maskForRealLanguages (  ) 
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 867 of file ezcontentlanguage.php.

Referenced by eZContentObject::removeTranslation().

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

Definition at line 742 of file ezcontentlanguage.php.

Referenced by remove().

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

Definition at line 789 of file ezcontentlanguage.php.

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

Referenced by eZContentClass::canInstantiateLanguages().

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

Referenced by eZContentObject::canCreateLanguages(), eZContentObject::canEditLanguages(), languagesSQLFilter(), prioritizedLanguageCodes(), prioritizedLanguagesByLocaleList(), prioritizedLanguagesByMask(), setPrioritizedLanguages(), sqlFilter(), topPriorityLanguage(), topPriorityLanguageByLocaleList(), topPriorityLanguageByMask(), eZContentObjectVersion::unserialize(), eZContentObject::unserialize(), and eZSerializedObjectNameList::untranslatedLanguages().

eZContentLanguage::prioritizedLanguagesByLocaleList ( languageLocaleList  ) 

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

Referenced by eZSerializedObjectNameList::prioritizedLanguages().

eZContentLanguage::prioritizedLanguagesByMask ( mask  ) 

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

Referenced by jsArrayByMask(), and eZContentObject::languages().

eZContentLanguage::remove (  ) 

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

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

eZContentLanguage::setCronjobMode ( enable = true  ) 

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

Referenced by clearCronjobMode().

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

Referenced by clearPrioritizedLanguages(), eZContentObjectTreeNode::subTree(), eZContentObjectTreeNode::subTreeCount(), and eZContentObjectTreeNode::subTreeMultiPaths().

eZContentLanguage::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. e. in the most prioritized language from those in which an object exists.

Parameters:
languageTable Name of the table containing the attribute with the language id.
languageListTable Name of the table containing the attribute with the available languages bitmap.
languageAttributeName Optional. Name of the attribute in $languageTable which contains the language id. 'language_id' by default.
languageListAttributeName Optional. Name of the attribute in $languageListTable which contains the bitmap mask. 'language_mask' by default.
Returns:
SQL where-condition described above.

Definition at line 654 of file ezcontentlanguage.php.

Referenced by eZContentObjectTreeNode::createAttributeFilterSQLStrings(), eZContentObjectTreeNode::createSortingSQLStrings(), eZContentObjectTreeNode::createVersionNameJoinsSQLString(), eZContentObjectTreeNode::fetch(), eZContentObjectVersion::fetchAttributes(), eZContentObject::fetchByNodeID(), eZContentObject::fetchIDArray(), eZContentObject::relatedObjects(), eZContentClassName::sqlAppendFilter(), eZContentClassName::sqlFilter(), and eZContentObjectTreeNode::subTreeCount().

eZContentLanguage::topPriorityLanguage (  )  [static]

Returns the most prioritized language.

Returns:
eZContentLanguage object for the most prioritized language.

Definition at line 419 of file ezcontentlanguage.php.

Referenced by eZContentObject::defaultLanguage().

eZContentLanguage::topPriorityLanguageByLocaleList ( languageLocaleList  ) 

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

Referenced by eZSerializedObjectNameList::topPriorityLanguage().

eZContentLanguage::topPriorityLanguageByMask ( mask  ) 

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

Referenced by eZContentObject::eZContentObject().

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

Definition at line 803 of file ezcontentlanguage.php.

eZContentLanguage::updateObjectNames (  ) 
Deprecated:

Definition at line 811 of file ezcontentlanguage.php.


The documentation for this class was generated from the following file:
Generated on Mon Jul 12 07:10:15 2010 for eZ publish by  doxygen 1.6.3