Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Serializers\MapSerializer Class Reference
+ Inheritance diagram for Wikibase\DataModel\Serializers\MapSerializer:

Public Member Functions

 __construct (bool $useObjectsForEmptyMaps)
 

Protected Member Functions

 serializeMap (array $serialization)
 Create the serialized representation of the supplied object.
 

Protected Attributes

bool $useObjectsForEmptyMaps
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Serializers\MapSerializer::__construct ( bool $useObjectsForEmptyMaps)

Member Function Documentation

◆ serializeMap()

Wikibase\DataModel\Serializers\MapSerializer::serializeMap ( array $serialization)
protected

Create the serialized representation of the supplied object.

Based on the $useObjectsForEmptyMaps flag, arrays in the serialized structure may be transformed into stdClass / objects. This helps ensure that in JSON serialization, PHP uses {} instead of [] for these dictionaries.

Currently the flag is only set in limited cases, including for the creation of JSON Dumps (per T305660). Setting the flag in all cases has undesired interactions with other serialisation code.

Returns
array|\stdClass

Member Data Documentation

◆ $useObjectsForEmptyMaps

bool Wikibase\DataModel\Serializers\MapSerializer::$useObjectsForEmptyMaps
protected

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