kernel/classes/ezcontentlanguage.php

Show: inherited
Table of Contents

File containing the eZContentLanguage class.

Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Package
kernel  
Version
4.6.0  

\eZContentLanguage

Package: kernel

File containing the eZContentLanguage class.

Parent(s)
\eZPersistentObject
Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Version
4.6.0  

Constants

Constant  MAX_COUNT = 30

Properties

Propertypublic  $PersistentDataDirty= ''
Details
Type
n/a
Inherited_from
\eZPersistentObject::$$PersistentDataDirty  

Methods

methodpublicaddLanguage(  $locale,  $name = null ) : void
static

Adds new language to the site.

\param locale Locale code (e.g. 'slk-SK') of language to add. \param name Optional. Name of the language. If not specified, the international language name for the $locale locale will be used. \return 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). \static

Parameters
Name Type Description
$locale
$name
methodpublicattribute(  $attr,  $noFunction = false ) : void
inherited

Inherited from: \eZPersistentObject::attribute()
Parameters
Name Type Description
$attr
$noFunction
methodpublicattributes( ) : void
inherited

Inherited from: \eZPersistentObject::attributes()
methodpublicclassCount( ) : void

\return The count of classes containing the translation in this language.

methodpublicclearCronjobMode( ) : void
static

Switches off the cronjob mode.

\see eZContentLanguage::setCronjobMode()

methodpublicclearPrioritizedLanguages( ) : void
static

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

\static

methodpublicconditionText(  $conditions ) : void
staticinherited

Inherited from: \eZPersistentObject::conditionText()
Parameters
Name Type Description
$conditions
methodpublicconditionTextByRow(  $conditions,  $row ) : void
staticinherited

Inherited from: \eZPersistentObject::conditionTextByRow()
Parameters
Name Type Description
$conditions
$row
methodpubliccount(  $def,  $conds = null,  $field = null ) : void
staticinherited

Inherited from: \eZPersistentObject::count()
Parameters
Name Type Description
$def
$conds
$field
methodpublicdecodeLanguageMask( int $langMask, boolean $returnLanguageLocale = false ) : array
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
Name Type Description
$langMask int
$returnLanguageLocale boolean
Returns
Type Description
array
methodpublicdefinition( ) : void
static

Persistent object's definition.

methodpubliceZContentLanguage(  $row = array() ) : void

Constructor.

\param row Parameter passed to the constructor of eZPersistentObject.

Parameters
Name Type Description
$row
methodpubliceZPersistentObject(  $row ) : void
inherited

Inherited from: \eZPersistentObject::eZPersistentObject()
Parameters
Name Type Description
$row
methodpublicescapeArray(  $array ) : void
staticinherited

Inherited from: \eZPersistentObject::escapeArray()
Parameters
Name Type Description
$array
methodpublicexpireCache( ) : void
static

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

\static

methodpublicfetch(  $id ) : void
static

Fetches the language identified by ID.

\param id Identifier of the language to fetch. \return eZContentLanguage object of language identified by ID $id. \static

Parameters
Name Type Description
$id
methodpublicfetchByLocale(  $locale,  $createIfNotExist = false ) : void
static

Fetches the language identified by locale code.

\param locale Locale of the language to fetch, e. g. 'slk-SK'. \return eZContentLanguage object identified by locale code $locale.

Parameters
Name Type Description
$locale
$createIfNotExist
methodpublicfetchLimitationList(  $forceReloading = false ) : void
static

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

\param forceReloading Optional. If true, the list will be fetched from database even if it is cached in memory. Default value is false. \return Array with names and IDs of the languages used on the site. \static

Parameters
Name Type Description
$forceReloading
methodpublicfetchList(  $forceReloading = false ) : void
static

Fetches the list of the languages used on the site.

\param forceReloading Optional. If true, the list will be fetched from database even if it is cached in memory. Default value is false. \return Array of the eZContentLanguage objects of languages used on the site. \static

Parameters
Name Type Description
$forceReloading
methodpublicfetchLocaleList( ) : void
static

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

\return Array of locale codes of the languages used on the site. \static

methodpublicfetchObject(  $def,  $field_filters,  $conds,  $asObject = true,  $grouping = null,  $custom_fields = null ) : void
staticinherited

Inherited from: \eZPersistentObject::fetchObject()
Parameters
Name Type Description
$def
$field_filters
$conds
$asObject
$grouping
$custom_fields
methodpublicfetchObjectList(  $def,  $field_filters = null,  $conds = null,  $sorts = null,  $limit = null,  $asObject = true,  $grouping = false,  $custom_fields = null,  $custom_tables = null,  $custom_conds = null ) : void
staticinherited

Inherited from: \eZPersistentObject::fetchObjectList()
Parameters
Name Type Description
$def
$field_filters
$conds
$sorts
$limit
$asObject
$grouping
$custom_fields
$custom_tables
$custom_conds
methodpublicfill(  $row ) : void
inherited

Inherited from: \eZPersistentObject::fill()
Parameters
Name Type Description
$row
methodpublicgetShortAttributeName(  $db,  $def,  $attrName ) : void
staticinherited

Inherited from: \eZPersistentObject::getShortAttributeName()
Parameters
Name Type Description
$db
$def
$attrName
methodpublichandleRows(  $rows,  $class_name,  $asObject ) : void
staticinherited

Inherited from: \eZPersistentObject::handleRows()
Parameters
Name Type Description
$rows
$class_name
$asObject
methodpublichasAttribute(  $attr ) : void
inherited

Inherited from: \eZPersistentObject::hasAttribute()
Parameters
Name Type Description
$attr
methodpublichasDirtyData( ) : void
inherited

Inherited from: \eZPersistentObject::hasDirtyData()
methodpublicidByLocale(  $locale ) : void
static

\static Returns id of the language specified.

\param locale String specifying locale code of the language, e. g. 'slk-SK' \return ID of the language specified by locale or false if the language is not set on the site.

Parameters
Name Type Description
$locale
methodpublicjsArrayByMask(  $mask ) : void
static

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

\param mask Bitmap mask specifying which languages should be considered. \return JavaScript array described above.

Parameters
Name Type Description
$mask
methodpubliclanguagesByMask(  $mask ) : void
static

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

\param mask Bitmap specifying which languages should be returned. \return Array of eZContentLanguage objects of languages which have set the corresponding bit in $mask.

Parameters
Name Type Description
$mask
methodpubliclanguagesSQLFilter(  $languageListTable,  $languageListAttributeName = 'language_mask' ) : void
static

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

\param languageListTable Name of the table \param languageListAttributeName Optional. Name of the attribute in the table which contains the bitmap mask. 'language_mask' by default. \return SQL where-condition described above. \static

Parameters
Name Type Description
$languageListTable
$languageListAttributeName
methodpubliclocaleObject( ) : void

\return Locale object for this language.

methodpublicmaskByLocale(  $locales,  $setZerothBit = false ) : void
static

Returns bitmap mask for the specified languages.

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

Parameters
Name Type Description
$locales
$setZerothBit
methodpublicmaskForRealLanguages( ) : void
static

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

methodpublicnewObjectOrder(  $def,  $orderField,  $conditions ) : void
staticinherited

Inherited from: \eZPersistentObject::newObjectOrder()
Parameters
Name Type Description
$def
$orderField
$conditions
methodpublicobjectCount( ) : void

\return The count of objects containing the translation in this language.

methodpublicobjectInitialCount( ) : void

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

methodpublicprioritizedLanguageCodes( ) : void
static

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

\return Array of the locale codes of the prioritized languages (in the correct order). \see eZContentLanguage::prioritizedLanguages() \static

methodpublicprioritizedLanguages(  $languageList = false ) : void
static

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

\param 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(). \return Array of the eZContentLanguage objects of the prioritized languages. \static

Parameters
Name Type Description
$languageList
methodpublicprioritizedLanguagesByLocaleList(  $languageLocaleList ) : void
static

Returns array of prioritized languages which are listed in \a $languageLocaleList.

The function does the same as 'prioritizedLanguagesByMask' but uses language locale list instead of language mask.

\param languageLocaleList List of language locales to choose from. \return Array of eZContentLanguage objects of prioritized languages which have set the corresponding bit in $mask.

Parameters
Name Type Description
$languageLocaleList
methodpublicprioritizedLanguagesByMask(  $mask ) : void
static

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

\param mask Bitmap specifying which languages should be returned. \return Array of eZContentLanguage objects of prioritized languages which have set the corresponding bit in $mask.

Parameters
Name Type Description
$mask
methodpublicremove(  $conditions = null,  $extraConditions = null ) : void
inherited

Inherited from: \eZPersistentObject::remove()
Parameters
Name Type Description
$conditions
$extraConditions
methodpublicremoveLanguage(  $id ) : void
static

Removes the language specified by ID.

\param id ID of the language to be removed. \return True if the language was removed from the site, false otherwise. \static

Parameters
Name Type Description
$id
methodpublicremoveObject(  $def,  $conditions = null,  $extraConditions = null ) : void
staticinherited

Inherited from: \eZPersistentObject::removeObject()
Parameters
Name Type Description
$def
$conditions
$extraConditions
methodpublicremoveThis( ) : void

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

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

methodpublicreorderObject(  $def,  $orderField,  $conditions,  $down = true ) : void
staticinherited

Inherited from: \eZPersistentObject::reorderObject()
Parameters
Name Type Description
$def
$orderField
$conditions
$down
methodpublicreplaceFieldsWithShortNames(  $db,  $fieldDefs,  $fields ) : void
staticinherited

Inherited from: \eZPersistentObject::replaceFieldsWithShortNames()
Parameters
Name Type Description
$db
$fieldDefs
$fields
methodpublicsetAttribute(  $attr,  $val ) : void
inherited

Inherited from: \eZPersistentObject::setAttribute()
Parameters
Name Type Description
$attr
$val
methodpublicsetCronjobMode(  $enable = true ) : void
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.

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

Parameters
Name Type Description
$enable
methodpublicsetHasDirtyData(  $hasDirtyData ) : void
inherited

Inherited from: \eZPersistentObject::setHasDirtyData()
Parameters
Name Type Description
$hasDirtyData
methodpublicsetPrioritizedLanguages(  $languages ) : void
static

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

\param languages Locale codes of the languages which will override the prioritized languages (the order is relevant). \static

Parameters
Name Type Description
$languages
methodpublicsqlFilter(  $languageTable,  $languageListTable = null,  $languageAttributeName = 'language_id',  $languageListAttributeName = 'language_mask' ) : void
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.

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

Parameters
Name Type Description
$languageTable
$languageListTable
$languageAttributeName
$languageListAttributeName
methodpublicstore(  $fieldFilters = null ) : void
inherited

Inherited from: \eZPersistentObject::store()
Parameters
Name Type Description
$fieldFilters
methodpublicstoreObject(  $obj,  $fieldFilters = null ) : void
staticinherited

Inherited from: \eZPersistentObject::storeObject()
Parameters
Name Type Description
$obj
$fieldFilters
methodpublicswapRow(  $table,  $keys,  $order_id,  $rows,  $id1,  $id2 ) : void
staticinherited

Inherited from: \eZPersistentObject::swapRow()
Parameters
Name Type Description
$table
$keys
$order_id
$rows
$id1
$id2
methodpublicsync(  $fieldFilters = null ) : void
inherited

Inherited from: \eZPersistentObject::sync()
Parameters
Name Type Description
$fieldFilters
methodpublictopPriorityLanguage( ) : void
static

Returns the most prioritized language.

\return eZContentLanguage object for the most prioritized language. \static

methodpublictopPriorityLanguageByLocaleList(  $languageLocaleList ) : void
static

Returns the most prioritized language from specified by \a $languageLocaleList list of language locales.

The function does the same as 'topPriorityLanguageByMask' but uses language locale list instead of language mask.

\param languageLocaleList List of language locales to choose from. \return eZContentLanguage object of the most prioritized language.

Parameters
Name Type Description
$languageLocaleList
methodpublictopPriorityLanguageByMask(  $mask ) : void
static

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

\param mask Bitmap specifying which languages should be checked. \return eZContentLanguage object of the most prioritized language which have set the corresponding bit in $mask.

Parameters
Name Type Description
$mask
methodpublictranslation( ) : void

\return Reference to itself. Kept because of the backward compatibility.

methodpublicupdateObjectList(  $parameters ) : void
staticinherited

Inherited from: \eZPersistentObject::updateObjectList()
Parameters
Name Type Description
$parameters
methodpublicupdateObjectNames( ) : void

\deprecated

Documentation was generated by DocBlox 0.18.1.