WikiLambda
MediaWiki WikiLambda extension
|
Static Public Member Functions | |
static | getIsoCode ( $code, $name, $class) |
static | isValidSerialisedZObject (string $input) |
static | isValidZObject ( $input) |
static | isValidZObjectList (array $input) |
static | isValidZObjectResolver ( $input) |
static | isValidZObjectRecord (stdClass $input) |
static | canonicalize ( $input) |
Canonicalizes a ZObject. | |
static | orderZKeyIDs (string $left, string $right) |
Compares IDs of ZKeys in an order. | |
static | canonicalizeZRecord (stdClass $input) |
Canonicalizes a record-like ZObject. | |
static | comparableString (string $input) |
Normalise and down-cast a label for database comparison by normalising Unicode, lower-casing, and collapsing accents. | |
static | filterZMultilingualStringsToLanguage ( $input, array $languages=[]) |
Filters ZObject to preferred language. | |
static | getPreferredMonolingualString (array $multilingualStr, array $languages) |
Filters ZMonolingualString to preferred language. | |
static | normalize ( $input) |
Returns a normalized ZObject. | |
static | isTypeEqualTo ( $type1, $type2) |
Asserts whether two types are equivalent. | |
static | normalizeZStringsAndZReferences ( $input) |
Returns the ZObject with normalized ZStrings and ZReferences. | |
static | isValidZObjectReference (string $input) |
Is the input a ZObject reference key (e.g. | |
static | isNullReference (string $input) |
Is the input a null reference (Z0)? | |
static | isValidOrNullZObjectReference (string $input) |
Is the input a ZObject reference key (e.g. | |
static | isValidId (string $input) |
Is the input a valid possible identifier across WMF projects? | |
static | isValidZObjectKey (string $input) |
Is the input a ZObject reference key (e.g. | |
static | isValidZObjectGlobalKey (string $input) |
Is the input a global ZObject reference key (e.g. | |
static | getZObjectReferenceFromKey (string $input) |
Split out the ZObject reference from a given global reference key (e.g. | |
static | getIterativeList ( $list) |
Given an array or a ZTypedList, returns an array that can be iterated over. | |
static | getRequiredZids ( $zobject) |
static | getLabelOfReference ( $zid, $zobject, $lang) |
Returns the natural language label of a given Zid in the language passed as parameter or available fallback languages. | |
static | getLabelOfGlobalKey ( $key, $zobject, $lang) |
Returns the natural language label of a given type key, function argument or error key in the language passed as parameter or available fallback languages. | |
static | getLabelOfLocalKey ( $key, $zobject, $data, $lang) |
static | getLabelOfErrorTypeKey ( $key, $zobject, $lang) |
Returns the natural language label of a given ZKey in the language passed as parameter or available fallback languages. | |
static | getLabelOfTypeKey ( $key, $zobject, $lang) |
Returns the natural language label of a given ZKey in the language passed as parameter or available fallback languages. | |
static | getLabelOfFunctionArgument ( $key, $zobject, $lang) |
Returns the natural language label of a given ZArgument in the language passed as parameter or available fallback languages. | |
static | extractHumanReadableZObject ( $zobject, $data, $lang) |
Translates a serialized ZObject from Zids and ZKeys to natural language in the language passed as parameter or available fallback languages. | |
|
static |
Canonicalizes a ZObject.
string | array | stdClass | $input | decoded JSON object for a valid ZObject |
|
static |
Canonicalizes a record-like ZObject.
This trims and sorts the keys.
stdClass | $input | The decoded JSON object of a well-formed ZObject |
|
static |
Normalise and down-cast a label for database comparison by normalising Unicode, lower-casing, and collapsing accents.
TODO: To consider further changes.
string | $input | The input |
|
static |
Translates a serialized ZObject from Zids and ZKeys to natural language in the language passed as parameter or available fallback languages.
stdClass | array | string | $zobject | |
ZPersistentObject[] | $data | |
Language | $lang |
|
static |
Filters ZObject to preferred language.
Given a ZObject, reduces all its ZMultilingualStrings to only the preferred language or fallbacks.
array | stdClass | string | $input | decoded JSON object for a ZObject |
string[] | $languages | array of language Zids |
|
static |
string | $code | The MW language code |
string | $name | The plain text name of the language |
string | $class | The name of the class for the HTML element |
|
static |
Given an array or a ZTypedList, returns an array that can be iterated over.
array | ZTypedList | $list |
|
static |
Returns the natural language label of a given ZKey in the language passed as parameter or available fallback languages.
If not available, returns the non-translated ZKey.
string | $key | |
ZPersistentObject | $zobject | |
Language | $lang |
|
static |
Returns the natural language label of a given ZArgument in the language passed as parameter or available fallback languages.
If not available, returns the non-translated ZKey.
string | $key | |
ZPersistentObject | $zobject | |
Language | $lang |
|
static |
Returns the natural language label of a given type key, function argument or error key in the language passed as parameter or available fallback languages.
If not available, returns the untranslated key Id.
string | $key | |
ZPersistentObject | $zobject | |
Language | $lang |
|
static |
string | $key | |
\stdClass | $zobject | |
ZPersistentObject[] | $data | |
Language | $lang |
|
static |
Returns the natural language label of a given Zid in the language passed as parameter or available fallback languages.
If not available, returns the non-translated Zid.
string | $zid | |
ZPersistentObject | $zobject | |
Language | $lang |
|
static |
Returns the natural language label of a given ZKey in the language passed as parameter or available fallback languages.
If not available, returns the non-translated ZKey.
string | $key | |
ZPersistentObject | $zobject | |
Language | $lang |
|
static |
Filters ZMonolingualString to preferred language.
Returns the preferred ZMonolingualString of a ZMultilingualString given an array of preferred languages.
array | $multilingualStr | decoded JSON for a ZMultilingualString value (Z12K1) |
string[] | $languages | array of language Zids |
|
static |
string | array | \stdClass | $zobject |
|
static |
Split out the ZObject reference from a given global reference key (e.g.
'Z1' from 'Z1K1').
string | $input |
|
static |
Is the input a null reference (Z0)?
string | $input |
|
static |
Asserts whether two types are equivalent.
stdClass | string | $type1 | |
stdClass | string | $type2 |
|
static |
Is the input a valid possible identifier across WMF projects?
string | $input |
|
static |
Is the input a ZObject reference key (e.g.
Z1 or Z12345)?
string | $input |
|
static |
string | $input |
|
static |
string | array | stdClass | $input |
ZErrorException |
|
static |
Is the input a global ZObject reference key (e.g.
Z1K1)?
string | $input |
|
static |
Is the input a ZObject reference key (e.g.
Z1K1 or K12345)?
string | $input |
|
static |
array | $input |
ZErrorException |
|
static |
stdClass | $input |
ZErrorException |
|
static |
Is the input a ZObject reference key (e.g.
Z1 or Z12345)?
string | $input |
|
static |
mixed | $input |
ZErrorException |
|
static |
Returns a normalized ZObject.
string | array | stdClass | $input | decoded JSON canonical form of a ZObject |
|
static |
Returns the ZObject with normalized ZStrings and ZReferences.
Given a canonical ZObject, returns the normal form with the following exceptions: lists, ZMultilingualString, ZMonolingualString
string | array | stdClass | $input | decoded JSON canonical form of a ZObject |
|
static |
Compares IDs of ZKeys in an order.
First come global ZIDs, then local ones. The globals are sorted first numerically by the Z-Number, and then by the K-Number.
string | $left | left key for comparision |
string | $right | right key for comparision |