WikiLambda
MediaWiki WikiLambda extension
Loading...
Searching...
No Matches
MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet Class Reference
+ Inheritance diagram for MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet:
+ Collaboration diagram for MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet:

Public Member Functions

 __construct ( $strings=[])
 Construct a ZMultiLingualStringSet instance given an array or a ZTypedList of ZMonoLingualStringSet instances.
 
 isValid ()
 @inheritDoc
 
 getZValue ()
 Get the list of ZMonoLingualStringSets that represent the value of this ZMultiLingualStringSet.
 
 getValueAsList ()
 Get the values of this ZMultiLingualStringSet in the shape of an array with language as key and array of strings as value.
 
 getAliasesForLanguageCode (string $languageCode)
 Fetch the ZMultiLingualStringSet's stored values for a given MediaWiki language code (e.g.
 
 getAliasesForLanguage (Language $language)
 Fetch the ZMultiLingualStringSet's stored value for a given MediaWiki language class.
 
 isLanguageProvidedValue (string $languageCode)
 Check if the ZMultiLingualStringSet has a stored value for a given MediaWiki language code (e.g.
 
 setMonoLingualStringSet (ZMonoLingualStringSet $value)
 Add or replace a ZMonoLingualStringSet.
 
 getSerialized ( $form=self::FORM_CANONICAL)
 Convert this ZObject into its serialized canonical representation.
 
- Public Member Functions inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject
 getValueByKey (string $key)
 Fetch value of given key from the current ZObject.
 
 setValueByKey (string $key, ZObject $value)
 Set a value of given key in the current ZObject.
 
 isBuiltin ()
 Returns whether this ZObject is a builtin class.
 
 isTypeReference ()
 Returns whether the object type is a ZReference that points to a type.
 
 isTypeFunctionCall ()
 Returns whether the object type is a ZFunctionCall that resolves to a type.
 
 getZTypeObject ()
 Returns either the ZReference or the ZFunctionCall that contain the type of this ZObject (Z1K1)
 
 getZType ()
 Returns a string with the Zid representing the type of this ZObject.
 
 getLinkedZObjects ()
 Return all ZObject Zids that are linked to the current ZObject.
 
 getHumanReadable ( $language=null)
 Convert this ZObject into human readable object by translating all keys and references into the preferred language or its fallbacks.
 
 __toString ()
 Over-ride the default __toString() method to serialise ZObjects into a JSON representation.
 

Static Public Member Functions

static getDefinition ()
 @inheritDoc
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject
const FORM_CANONICAL = 1
 
const FORM_NORMAL = 2
 
- Protected Attributes inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject
 $type = null
 
 $data = []
 
 $linkedZObjects = []
 

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::__construct ( $strings = [])

Construct a ZMultiLingualStringSet instance given an array or a ZTypedList of ZMonoLingualStringSet instances.

Parameters
ZTypedList | array$strings

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.

+ Here is the call graph for this function:

Member Function Documentation

◆ getAliasesForLanguage()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getAliasesForLanguage ( Language $language)

Fetch the ZMultiLingualStringSet's stored value for a given MediaWiki language class.

This will walk the language fallback chain until there is a set value to return.

Parameters
Language$languageThe MediaWiki language class in which the string is wanted.
Returns
string[] The aliases, possibly empty.

◆ getAliasesForLanguageCode()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getAliasesForLanguageCode ( string $languageCode)

Fetch the ZMultiLingualStringSet's stored values for a given MediaWiki language code (e.g.

'en' or 'zh-hant'). Note that this is a raw fetch and does not walk the language fallback chain; users are expected to use getStringForLanguage() which does.

Parameters
string$languageCodeThe MediaWiki language code in which the string is wanted.
Returns
string[] The aliases list, possibly empty.

◆ getDefinition()

static MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getDefinition ( )
static

@inheritDoc

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.

◆ getSerialized()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getSerialized ( $form = self::FORM_CANONICAL)

Convert this ZObject into its serialized canonical representation.

Parameters
int$form
Returns
\stdClass|array|string

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.

◆ getValueAsList()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getValueAsList ( )

Get the values of this ZMultiLingualStringSet in the shape of an array with language as key and array of strings as value.

Returns
array

◆ getZValue()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getZValue ( )

Get the list of ZMonoLingualStringSets that represent the value of this ZMultiLingualStringSet.

Returns
array

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.

◆ isLanguageProvidedValue()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::isLanguageProvidedValue ( string $languageCode)

Check if the ZMultiLingualStringSet has a stored value for a given MediaWiki language code (e.g.

'en' or 'zh-hant'). Note that this is a raw check and does not walk the language fallback chain.

Parameters
string$languageCodeThe MediaWiki language code in which the string is wanted.
Returns
bool If there is a list stored.

◆ isValid()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::isValid ( )

@inheritDoc

Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.

◆ setMonoLingualStringSet()

MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::setMonoLingualStringSet ( ZMonoLingualStringSet $value)

Add or replace a ZMonoLingualStringSet.

Parameters
ZMonoLingualStringSet$valueThe new value to set.
+ Here is the caller graph for this function:

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