MediaWiki master
MediaWiki\Json\JsonDeserializable Interface Reference

Classes implementing this interface support round-trip JSON serialization/deserialization using the JsonDeserializer utility. More...

Inherits JsonSerializable.

Collaboration diagram for MediaWiki\Json\JsonDeserializable:

Static Public Member Functions

static newFromJsonArray (JsonDeserializer $deserializer, array $json)
 Creates a new instance of the class and initialized it from the $json array.
 

Detailed Description

Classes implementing this interface support round-trip JSON serialization/deserialization using the JsonDeserializer utility.

The resulting JSON must be annotated with class information for deserialization to work. Use JsonDeserializableTrait in implementing classes which annotates the JSON automatically.

See also
JsonDeserializer
JsonDeserializableTrait
Since
1.36
Deprecated
since 1.45; use JsonCodecable in new code

Definition at line 24 of file JsonDeserializable.php.

Member Function Documentation

◆ newFromJsonArray()

static MediaWiki\Json\JsonDeserializable::newFromJsonArray ( JsonDeserializer $deserializer,
array $json )
static

Creates a new instance of the class and initialized it from the $json array.

Parameters
JsonDeserializer$deserializeran instance of JsonDeserializer to use for nested properties if they need special care.
array$json
Returns
JsonDeserializable

The documentation for this interface was generated from the following file: