WikiLambda
MediaWiki WikiLambda extension
|
Public Member Functions | |
__construct ( $functionCall, $firstItem=null, $secondItem=null) | |
Create a new ZTypedPair instance. | |
isValid () | |
Valid if both the first and second items are extant ZObjects of the right type (or the type is Z1) | |
getFirstType () | |
Returns the type of the first element of this ZTypedPair. | |
getFirstElement () | |
Returns the first element of this ZTypedPair. | |
setFirstElement (ZObject $newValue) | |
Sets the first element of this ZTypedPair. | |
getSecondType () | |
Returns the type of the second element of this ZTypedPair. | |
getSecondElement () | |
Returns the second element of this ZTypedPair. | |
setSecondElement (ZObject $newValue) | |
Sets the second element of this ZTypedPair. | |
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. | |
getZValue () | |
Return the generic content 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 | |
static | buildType ( $firstType, $secondType) |
Build the function call that defines the type of this Typed Pair. | |
Protected Attributes | |
$typeRegistry | |
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\ZTypedPair::__construct | ( | $functionCall, | |
$firstItem = null, | |||
$secondItem = null ) |
Create a new ZTypedPair instance.
ZFunctionCall | $functionCall | |
ZObject | null | $firstItem | |
ZObject | null | $secondItem |
|
static |
Build the function call that defines the type of this Typed Pair.
string | $firstType | |
string | $secondType |
|
static |
@inheritDoc
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedPair::getFirstElement | ( | ) |
Returns the first element of this ZTypedPair.
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedPair::getFirstType | ( | ) |
Returns the type of the first element of this ZTypedPair.
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedPair::getSecondElement | ( | ) |
Returns the second element of this ZTypedPair.
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedPair::getSecondType | ( | ) |
Returns the type of the second element of this ZTypedPair.
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedPair::isValid | ( | ) |
Valid if both the first and second items are extant ZObjects of the right type (or the type is Z1)
@inheritDoc
Reimplemented from MediaWiki\Extension\WikiLambda\ZObjects\ZObject.
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedPair::setFirstElement | ( | ZObject | $newValue | ) |
Sets the first element of this ZTypedPair.
ZObject | $newValue | The new first element |
MediaWiki\Extension\WikiLambda\ZObjects\ZTypedPair::setSecondElement | ( | ZObject | $newValue | ) |
Sets the second element of this ZTypedPair.
ZObject | $newValue | The new second element |