Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Serializers\SerializerFactory Class Reference

Factory for constructing Serializer objects that can serialize WikibaseDataModel objects. More...

+ Inheritance diagram for Wikibase\DataModel\Serializers\SerializerFactory:
+ Collaboration diagram for Wikibase\DataModel\Serializers\SerializerFactory:

Public Member Functions

 __construct (Serializer $dataValueSerializer, $options=0)
 
 newEntitySerializer ()
 
 newItemSerializer ()
 Returns a Serializer that can serialize Item objects.
 
 newPropertySerializer ()
 Returns a Serializer that can serialize Property objects.
 
 newSiteLinkSerializer ()
 Returns a Serializer that can serialize SiteLink objects.
 
 newStatementListSerializer ()
 Returns a Serializer that can serialize StatementList objects.
 
 newStatementSerializer ()
 Returns a Serializer that can serialize Statement objects.
 
 newReferencesSerializer ()
 Returns a Serializer that can serialize ReferenceList objects.
 
 newReferenceSerializer ()
 Returns a Serializer that can serialize Reference objects.
 
 newSnakListSerializer ( $serializeSnaksWithHash=true)
 Returns a Serializer that can serialize SnakList objects.
 
 newSnakSerializer ( $serializeWithHash=true)
 Returns a Serializer that can serialize Snak objects.
 
 newTypedSnakSerializer ( $serializeWithHash=true)
 Returns a Serializer that can serialize TypedSnak objects.
 
 newTermSerializer ()
 Returns a Serializer that can serialize Term objects.
 
 newTermListSerializer ()
 Returns a Serializer that can serialize TermList objects.
 
 newAliasGroupSerializer ()
 Returns a Serializer that can serialize AliasGroup objects.
 
 newAliasGroupListSerializer ()
 Returns a Serializer that can serialize AliasGroupList objects.
 

Public Attributes

const OPTION_DEFAULT = 0
 
const OPTION_OBJECTS_FOR_MAPS = 1
 
const OPTION_SERIALIZE_MAIN_SNAKS_WITHOUT_HASH = 2
 
const OPTION_SERIALIZE_QUALIFIER_SNAKS_WITHOUT_HASH = 4
 
const OPTION_SERIALIZE_REFERENCE_SNAKS_WITHOUT_HASH = 8
 
const OPTION_SERIALIZE_SNAKS_WITHOUT_HASH = 14
 Omit hashes when serializing snaks.
 
const OPTION_SERIALIZE_USE_OBJECTS_FOR_EMPTY_MAPS = 16
 

Private Member Functions

 shouldUseObjectsForEmptyMaps ()
 
 shouldSerializeMainSnaksWithHash ()
 
 shouldSerializeQualifierSnaksWithHash ()
 
 shouldSerializeReferenceSnaksWithHash ()
 

Private Attributes

int $options
 
Serializer $dataValueSerializer
 

Detailed Description

Factory for constructing Serializer objects that can serialize WikibaseDataModel objects.

Since
0.1
Author
Thomas Pellissier Tanon
Bene* < benes.nosp@m.tar..nosp@m.wikim.nosp@m.edia.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Serializers\SerializerFactory::__construct ( Serializer $dataValueSerializer,
$options = 0 )
Parameters
Serializer$dataValueSerializerserializer for DataValue objects
int$optionsset multiple with bitwise or
Exceptions
InvalidArgumentException

Member Function Documentation

◆ newAliasGroupListSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newAliasGroupListSerializer ( )

Returns a Serializer that can serialize AliasGroupList objects.

Since
1.5

◆ newAliasGroupSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newAliasGroupSerializer ( )

Returns a Serializer that can serialize AliasGroup objects.

Since
1.6

◆ newEntitySerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newEntitySerializer ( )
Returns
DispatchableSerializer A serializer that can only serialize Item and Property objects, but no other entity types. In contexts with custom entity types other than items and properties this is not what you want. If in doubt, favor a custom DispatchingSerializer containing the exact entity serializers you need.

◆ newItemSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newItemSerializer ( )

Returns a Serializer that can serialize Item objects.

Since
2.1

◆ newPropertySerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newPropertySerializer ( )

Returns a Serializer that can serialize Property objects.

Since
2.1

◆ newReferenceSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newReferenceSerializer ( )

Returns a Serializer that can serialize Reference objects.

◆ newReferencesSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newReferencesSerializer ( )

Returns a Serializer that can serialize ReferenceList objects.

◆ newSiteLinkSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newSiteLinkSerializer ( )

Returns a Serializer that can serialize SiteLink objects.

◆ newSnakListSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newSnakListSerializer ( $serializeSnaksWithHash = true)

Returns a Serializer that can serialize SnakList objects.

Parameters
bool$serializeSnaksWithHash
Since
1.4

◆ newSnakSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newSnakSerializer ( $serializeWithHash = true)

Returns a Serializer that can serialize Snak objects.

Parameters
bool$serializeWithHash

◆ newStatementListSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newStatementListSerializer ( )

Returns a Serializer that can serialize StatementList objects.

Since
1.4

◆ newStatementSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newStatementSerializer ( )

Returns a Serializer that can serialize Statement objects.

Since
1.4

◆ newTermListSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newTermListSerializer ( )

Returns a Serializer that can serialize TermList objects.

Since
1.5

◆ newTermSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newTermSerializer ( )

Returns a Serializer that can serialize Term objects.

Since
1.5

◆ newTypedSnakSerializer()

Wikibase\DataModel\Serializers\SerializerFactory::newTypedSnakSerializer ( $serializeWithHash = true)

Returns a Serializer that can serialize TypedSnak objects.

Parameters
bool$serializeWithHash
Since
1.3

◆ shouldSerializeMainSnaksWithHash()

Wikibase\DataModel\Serializers\SerializerFactory::shouldSerializeMainSnaksWithHash ( )
private

◆ shouldSerializeQualifierSnaksWithHash()

Wikibase\DataModel\Serializers\SerializerFactory::shouldSerializeQualifierSnaksWithHash ( )
private

◆ shouldSerializeReferenceSnaksWithHash()

Wikibase\DataModel\Serializers\SerializerFactory::shouldSerializeReferenceSnaksWithHash ( )
private

◆ shouldUseObjectsForEmptyMaps()

Wikibase\DataModel\Serializers\SerializerFactory::shouldUseObjectsForEmptyMaps ( )
private

Member Data Documentation

◆ $dataValueSerializer

Serializer Wikibase\DataModel\Serializers\SerializerFactory::$dataValueSerializer
private

◆ $options

int Wikibase\DataModel\Serializers\SerializerFactory::$options
private

◆ OPTION_DEFAULT

const Wikibase\DataModel\Serializers\SerializerFactory::OPTION_DEFAULT = 0

◆ OPTION_OBJECTS_FOR_MAPS

const Wikibase\DataModel\Serializers\SerializerFactory::OPTION_OBJECTS_FOR_MAPS = 1
Since
1.2.0
Deprecated
since 2.10.0 option has no effect

◆ OPTION_SERIALIZE_MAIN_SNAKS_WITHOUT_HASH

const Wikibase\DataModel\Serializers\SerializerFactory::OPTION_SERIALIZE_MAIN_SNAKS_WITHOUT_HASH = 2
Since
1.7.0
Deprecated
since 2.5 use OPTION_SERIALIZE_SNAKS_WITHOUT_HASH

◆ OPTION_SERIALIZE_QUALIFIER_SNAKS_WITHOUT_HASH

const Wikibase\DataModel\Serializers\SerializerFactory::OPTION_SERIALIZE_QUALIFIER_SNAKS_WITHOUT_HASH = 4
Since
1.7.0
Deprecated
since 2.5 use OPTION_SERIALIZE_SNAKS_WITHOUT_HASH

◆ OPTION_SERIALIZE_REFERENCE_SNAKS_WITHOUT_HASH

const Wikibase\DataModel\Serializers\SerializerFactory::OPTION_SERIALIZE_REFERENCE_SNAKS_WITHOUT_HASH = 8
Since
1.7.0
Deprecated
since 2.5 use OPTION_SERIALIZE_SNAKS_WITHOUT_HASH

◆ OPTION_SERIALIZE_SNAKS_WITHOUT_HASH

const Wikibase\DataModel\Serializers\SerializerFactory::OPTION_SERIALIZE_SNAKS_WITHOUT_HASH = 14

Omit hashes when serializing snaks.

Since
2.5.0

◆ OPTION_SERIALIZE_USE_OBJECTS_FOR_EMPTY_MAPS

const Wikibase\DataModel\Serializers\SerializerFactory::OPTION_SERIALIZE_USE_OBJECTS_FOR_EMPTY_MAPS = 16

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