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

Public Member Functions

 clearCronjobMode ()
 Switches off the cronjob mode. More...
 
 definition ()
 Persistent object's definition. More...
 
 eZContentLanguage ($row=array())
 Constructor. More...
 
 fetchByLocale ($locale)
 Fetches the language identified by locale code. More...
 
 jsArrayByMask ($mask)
 Returns the Javascript array with locale codes and names of the languages which have set the corresponding bit in specified mask. More...
 
 languagesByMask ($mask)
 Returns array of languages which have set the corresponding bit in the mask. More...
 
localeObject ()
 
 maskByLocale ($locales, $setZerothBit=false)
 Returns bitmap mask for the specified languages. More...
 
 maskForRealLanguages ()
 
objectCount ()
 
 objectInitialCount ()
 
 prioritizedLanguagesByMask ($mask)
 Returns array of prioritized languages which have set the corresponding bit in the mask. More...
 
 remove ()
 Removes the language if there is no object having translation in it. More...
 
 setCronjobMode ($enable=true)
 Switches on the cronjob mode. More...
 
 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...
 
 topPriorityLanguageByMask ($mask)
 Returns the most prioritized language which has set the corresponding bit in the mask. More...
 
translation ()
 
 updateObjectNames ()
 
- Public Member Functions inherited from eZPersistentObject
attribute ($attr, $noFunction=false)
 
 attributes ()
 
 conditionText (&$conditions)
 
conditionTextByRow (&$conditions, &$row)
 
 definition ()
 
escapeArray (&$array)
 
 eZPersistentObject ($row)
 
 fetchObject (&$def, $field_filters, $conds, $asObject=true, $grouping=null, $custom_fields=null)
 
 fetchObjectList (&$def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null)
 
 fill (&$row)
 
 getShortAttributeName (&$db, &$def, $attrName)
 
 handleRows (&$rows, $class_name, $asObject)
 
 hasAttribute ($attr)
 
 hasDirtyData ()
 
 newObjectOrder (&$def, $orderField, $conditions)
 
 remove ($conditions=null, $extraConditions=null)
 
 removeObject (&$def, $conditions=null, $extraConditions=null)
 
 reorderObject (&$def, $orderField, $conditions, $down=true)
 
 setAttribute ($attr, $val)
 
 setHasDirtyData ($hasDirtyData)
 
 store ($fieldFilters=null)
 
 swapRow ($table, &$keys, &$order_id, &$rows, $id1, $id2)
 
 sync ($fieldFilters=null)
 
 updateObjectList ($parameters)
 

Static Public Member Functions

 addLanguage ($locale, $name=null)
 Adds new language to the site. More...
 
 clearPrioritizedLanguages ()
 Clears the prioritized language list set by eZContentLanguage::setPrioritizedLanguages and reloading the list from INI settings. More...
 
 expireCache ()
 Removes all memory cache forcing it to read from database again for next method calls. More...
 
 fetch ($id)
 Fetches the language identified by ID. More...
 
 fetchLimitationList ($forceReloading=false)
 Fetches the array with names and IDs of the languages used on the site. More...
 
 fetchList ($forceReloading=false)
 Fetches the list of the languages used on the site. More...
 
 fetchLocaleList ()
 Fetches the array of locale codes of the languages used on the site. More...
 
 idByLocale ($locale)
 Returns id of the language specified. More...
 
 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...
 
 prioritizedLanguageCodes ()
 Returns the array of the locale codes of the prioritized languages (in the correct order). More...
 
 prioritizedLanguages ($languageList=false)
 Fetches the list of the prioritized languages (in the correct order). More...
 
 removeLanguage ($id)
 Removes the language specified by ID. More...
 
 setPrioritizedLanguages ($languages)
 Overrides the prioritized languages set by INI settings with the specified languages. More...
 
 topPriorityLanguage ()
 Returns the most prioritized language. More...
 

Member Function Documentation

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

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

eZContentLanguage::clearCronjobMode ( )

Switches off the cronjob mode.

See Also
eZContentLanguage::setCronjobMode()
eZContentLanguage::clearPrioritizedLanguages ( )
static

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

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

eZContentLanguage::definition ( )

Persistent object's definition.

Referenced by fetchList().

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

eZContentLanguage::fetch (   $id)
static

Fetches the language identified by ID.

Parameters
idIdentifier of the language to fetch.
Returns
eZContentLanguage object of language identified by ID $id.

Referenced by eZContentObjectVersion\initialLanguage(), eZContentObject\initialLanguage(), removeLanguage(), eZContentObject\removeTranslation(), and eZContentObject\versionLanguageName().

eZContentLanguage::fetchByLocale (   $locale)

Fetches the language identified by locale code.

Parameters
localeLocale of the language to fetch, e. g. 'slk-SK'.
Returns
eZContentLanguage object identified by locale code $locale.

Referenced by addLanguage(), eZContentObject\currentLanguageObject(), eZContentObject\defaultLanguage(), idByLocale(), eZStepCreateSites\initializePackage(), maskByLocale(), prioritizedLanguages(), eZContentObjectVersion\unserialize(), and eZContentObject\unserialize().

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.
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(), eZMultiplexerType\attribute(), eZApproveType\attribute(), fetch(), fetchByLocale(), fetchLimitationList(), fetchLocaleList(), languagesByMask(), maskForRealLanguages(), prioritizedLanguages(), remove(), eZContentObject\translationList(), and eZContentObject\translationStringList().

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

eZContentLanguage::idByLocale (   $locale)
static

Returns id of the language specified.

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

Referenced by eZContentObjectVersion\checkAccess(), eZContentObject\checkAccess(), eZContentObjectTreeNode\checkAccess(), eZContentObjectAttribute\clone(), eZContentObject\copyVersion(), eZContentObjectAttribute\create(), eZContentObjectVersion\create(), eZContentObject\create(), eZContentObject\setName(), eZContentObjectAttribute\translateTo(), and eZContentObject\versions().

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

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
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(), eZMultiplexerType\attributeDecoder(), eZApproveType\attributeDecoder(), and eZContentOperationCollection\copyTranslations().

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 eZContentObjectTreeNode\fetchNode(), eZContentObjectTreeNode\subTree(), and eZContentObjectTreeNode\subTreeMultiPaths().

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

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(), eZContentOperationCollection\setObjectStatusPublished(), 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.)

Referenced by eZContentObject\removeTranslation().

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

Referenced by remove().

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

eZContentLanguage::prioritizedLanguages (   $languageList = false)
static

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

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

Referenced by eZContentObject\canCreateLanguages(), eZContentObject\canEditLanguages(), eZContentFunctionCollection\fetchPrioritizedLanguages(), languagesSQLFilter(), prioritizedLanguageCodes(), prioritizedLanguagesByMask(), setPrioritizedLanguages(), sqlFilter(), topPriorityLanguage(), topPriorityLanguageByMask(), eZContentObjectVersion\unserialize(), and eZContentObject\unserialize().

eZContentLanguage::prioritizedLanguagesByMask (   $mask)

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(), 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.
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::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
enableOptional. If false, it will switch off the cronjob mode. True by default.

Referenced by clearCronjobMode().

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(), eZStepCreateSites\initializePackage(), 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
languageTableName of the table containing the attribute with bitmaps.
languageListTableName of the table containing the attribute with language id.
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\fetchByNodeID(), eZContentObject\fetchIDArray(), eZContentObject\relatedObjects(), eZSearchEngine\search(), and eZContentObjectTreeNode\subTreeCount().

eZContentLanguage::topPriorityLanguage ( )
static

Returns the most prioritized language.

Returns
eZContentLanguage object for the most prioritized language.

Referenced by eZContentObject\defaultLanguage().

eZContentLanguage::topPriorityLanguageByMask (   $mask)

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

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