|
| __construct ( $response, $metadata) |
| Construct a new ZResponseEnvelope instance.
|
|
| isValid () |
| @inheritDoc
|
|
| getZValue () |
| Get the value part of the response envelope.
|
|
| getZMetadata () |
| Get the Meta-data part of the response envelope.
|
|
| hasErrors () |
| Does the meta-data in the response envelope have one or more fatal errors?
|
|
| getErrors () |
| Does the meta-data in the response envelope have one or more fatal errors?
|
|
| setMetaDataValue ( $key, ZObject $value) |
| Set the meta-data in the response envelope to the given key.
|
|
| __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 | getDefinition () |
| @inheritDoc
|
|
static | wrapInResponseMap ( $key, $value) |
| Convenience method to make a ZTypedMap for a ZResponseEnvelope with a given key/value pair.
|
|
static | wrapErrorInResponseMap ( $error) |
| Convenience method to make a ZTypedMap for a ZResponseEnvelope for a ZError.
|
|
|
const | FORM_CANONICAL = 1 |
|
const | FORM_NORMAL = 2 |
|
| $type = null |
|
| $data = [] |
|
| $linkedZObjects = [] |
|
◆ __construct()
MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::__construct |
( |
| $response, |
|
|
| $metadata ) |
Construct a new ZResponseEnvelope instance.
- Parameters
-
?ZObject | $response | Value of the response |
?ZObject | $metadata | Meta-data response |
◆ getDefinition()
static MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::getDefinition |
( |
| ) |
|
|
static |
◆ getErrors()
MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::getErrors |
( |
| ) |
|
Does the meta-data in the response envelope have one or more fatal errors?
- Returns
- ZError|null
◆ getZMetadata()
MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::getZMetadata |
( |
| ) |
|
Get the Meta-data part of the response envelope.
TODO (T307483): This should ideally be type-hinted as a PHP implementation of ZMap, so that it'd be much easier to interact with.
- Returns
- ZObject
◆ getZValue()
MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::getZValue |
( |
| ) |
|
◆ hasErrors()
MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::hasErrors |
( |
| ) |
|
Does the meta-data in the response envelope have one or more fatal errors?
- Returns
- bool
◆ isValid()
MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::isValid |
( |
| ) |
|
◆ setMetaDataValue()
MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::setMetaDataValue |
( |
| $key, |
|
|
ZObject | $value ) |
Set the meta-data in the response envelope to the given key.
- Parameters
-
ZString | string | $key | The key to use |
ZObject | $value | The value to set |
◆ wrapErrorInResponseMap()
static MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::wrapErrorInResponseMap |
( |
| $error | ) |
|
|
static |
Convenience method to make a ZTypedMap for a ZResponseEnvelope for a ZError.
- Parameters
-
ZError | $error | The error to set |
- Returns
- ZTypedMap
◆ wrapInResponseMap()
static MediaWiki\Extension\WikiLambda\ZObjects\ZResponseEnvelope::wrapInResponseMap |
( |
| $key, |
|
|
| $value ) |
|
static |
Convenience method to make a ZTypedMap for a ZResponseEnvelope with a given key/value pair.
- Parameters
-
string | $key | The key to use |
ZObject | $value | The value to set |
- Returns
- ZTypedMap
The documentation for this class was generated from the following file: