WikiLambda
MediaWiki WikiLambda extension
|
Public Member Functions | |
__construct ( $zid, $value, $label, $aliases=null, $description=null) | |
Construct a ZPersistentObject instance. | |
isValid () | |
@inheritDoc | |
getZValue () | |
Get the generic content of the inner ZObject wrapped by this ZPersistentObject. | |
validateDescriptionLength ( $length, $context=null) | |
Validates the length of the description field for a persistent object. | |
validateLabelLength ( $length, $context=null) | |
Validates the length of the label field for a persistent object. | |
getZid () | |
Get the Zid that identifies this ZPersistentObject. | |
getInnerZObject () | |
Get the inner ZObject wrapped by this ZPersistentObject. | |
getInternalZType () | |
Get the type Zid of the ZObject wrapped by this ZPersistentObject. | |
getLabels () | |
Get the ZMultilingualString that contains the label of this ZPersistentObject. | |
getLabel ( $language, $defaultToEnglish=false) | |
Get the label for a given Language (or its fallback). | |
getAliases () | |
Get the ZMultilingualStringSet that contains the aliases for this ZPersistentObject. | |
getDescriptions () | |
Get the ZMultilingualString that contains the description of this ZPersistentObject. | |
getDescription ( $language, $defaultToEnglish=false) | |
Get the description for a given Language (or its fallback). | |
Public Member Functions inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject | |
__construct ( $type) | |
Construct a new ZObject instance. | |
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. | |
getSerialized ( $form=self::FORM_CANONICAL) | |
Convert this ZObject into its serialized canonical representation. | |
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 | |
Protected Attributes | |
$data = [] | |
Protected Attributes inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject | |
$type = null | |
$data = [] | |
$linkedZObjects = [] | |
Additional Inherited Members | |
Public Attributes inherited from MediaWiki\Extension\WikiLambda\ZObjects\ZObject | |
const | FORM_CANONICAL = 1 |
const | FORM_NORMAL = 2 |
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::__construct | ( | $zid, | |
$value, | |||
$label, | |||
$aliases = null, | |||
$description = null ) |
Construct a ZPersistentObject instance.
ZObject | $zid | ZString representing the Zid that identifies this ZPersistentObject |
ZObject | $value | ZObject to be wrapped in this ZPersistentObject |
ZObject | $label | ZMultiLingualString that contains this ZPersistentObject's label |
ZObject | null | $aliases | ZMultiLingualStringSet with this ZPersistentObject's aliases or null |
ZObject | null | $description | ZMultiLingualString that contains this ZPersistentObject's description |
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getAliases | ( | ) |
Get the ZMultilingualStringSet that contains the aliases for this ZPersistentObject.
|
static |
@inheritDoc
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getDescription | ( | $language, | |
$defaultToEnglish = false ) |
Get the description for a given Language (or its fallback).
Language | $language | Language in which to provide the description. |
bool | $defaultToEnglish |
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getDescriptions | ( | ) |
Get the ZMultilingualString that contains the description of this ZPersistentObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getInnerZObject | ( | ) |
Get the inner ZObject wrapped by this ZPersistentObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getInternalZType | ( | ) |
Get the type Zid of the ZObject wrapped by this ZPersistentObject.
TODO (T296822): The type can also be a function call.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getLabel | ( | $language, | |
$defaultToEnglish = false ) |
Get the label for a given Language (or its fallback).
Language | $language | Language in which to provide the label. |
bool | $defaultToEnglish |
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getLabels | ( | ) |
Get the ZMultilingualString that contains the label of this ZPersistentObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getZid | ( | ) |
Get the Zid that identifies this ZPersistentObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::getZValue | ( | ) |
Get the generic content of the inner ZObject wrapped by this ZPersistentObject.
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::isValid | ( | ) |
@inheritDoc
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::validateDescriptionLength | ( | $length, | |
$context = null ) |
Validates the length of the description field for a persistent object.
int | $length | The maximum length allowed for the description. |
MessageLocalizer | null | $context | The context of the action operation, for localisation of messages |
MediaWiki\Extension\WikiLambda\ZObjects\ZPersistentObject::validateLabelLength | ( | $length, | |
$context = null ) |
Validates the length of the label field for a persistent object.
int | $length | The maximum length allowed for the label. |
MessageLocalizer | null | $context | The context of the action operation, for localisation of messages |