Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\StatementRankSerializer Class Reference

Serializer and Deserializer for Statement Ranks. More...

+ Inheritance diagram for Wikibase\Repo\StatementRankSerializer:
+ Collaboration diagram for Wikibase\Repo\StatementRankSerializer:

Public Member Functions

 deserialize ( $serializedRank)
 Deserializes the rank and returns an element from the Statement::RANK_ enum.
 
 serialize ( $rank)
 Serializes the rank.
 

Static Public Member Functions

static getRanks ()
 Returns the available ranks in serialized form.
 

Static Private Attributes

static $rankMap
 

Detailed Description

Serializer and Deserializer for Statement Ranks.

Todo:
this could be moved to DataModelSerialization (in some form)

Member Function Documentation

◆ deserialize()

Wikibase\Repo\StatementRankSerializer::deserialize (   $serializedRank)

Deserializes the rank and returns an element from the Statement::RANK_ enum.

Parameters
string$serializedRank
Exceptions
DeserializationException
Returns
int PhanParamSignatureMismatch

◆ getRanks()

static Wikibase\Repo\StatementRankSerializer::getRanks ( )
static

Returns the available ranks in serialized form.

Returns
string[]

◆ serialize()

Wikibase\Repo\StatementRankSerializer::serialize (   $rank)

Serializes the rank.

Parameters
int$rank
Exceptions
SerializationException
Returns
string

Member Data Documentation

◆ $rankMap

Wikibase\Repo\StatementRankSerializer::$rankMap
staticprivate
Initial value:
= [
Statement::RANK_DEPRECATED => 'deprecated',
Statement::RANK_NORMAL => 'normal',
Statement::RANK_PREFERRED => 'preferred',
]

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