Wikibase
MediaWiki Wikibase extension
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. More...
 
 serialize ( $rank)
 Serializes the rank. More...
 

Static Public Member Functions

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

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_PREFERRED => 'preferred',
]
const RANK_PREFERRED
Rank enum.
Definition: Statement.php:29
const RANK_NORMAL
Definition: Statement.php:30
const RANK_DEPRECATED
Definition: Statement.php:31

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