WikiLambda
MediaWiki WikiLambda extension
|
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 = [] | |
MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::__construct | ( | $strings = [] | ) |
Construct a ZMultiLingualStringSet instance given an array or a ZTypedList of ZMonoLingualStringSet instances.
ZTypedList | array | $strings |
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
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.
Language | $language | The MediaWiki language class in which the string is wanted. |
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.
string | $languageCode | The MediaWiki language code in which the string is wanted. |
|
static |
@inheritDoc
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getSerialized | ( | $form = self::FORM_CANONICAL | ) |
Convert this ZObject into its serialized canonical representation.
int | $form |
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
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.
MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::getZValue | ( | ) |
Get the list of ZMonoLingualStringSets that represent the value of this ZMultiLingualStringSet.
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
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.
string | $languageCode | The MediaWiki language code in which the string is wanted. |
MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::isValid | ( | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZMultiLingualStringSet::setMonoLingualStringSet | ( | ZMonoLingualStringSet | $value | ) |
Add or replace a ZMonoLingualStringSet.
ZMonoLingualStringSet | $value | The new value to set. |