Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\DataModel\Statement\StatementGuid Class Reference

Immutable value object for a statement id. More...

+ Collaboration diagram for Wikibase\DataModel\Statement\StatementGuid:

Public Member Functions

 __construct (EntityId $entityId, string $guidPart, string $originalStatementId=null)
 
 getEntityId ()
 
 getGuidPart ()
 
 getSerialization ()
 If the $originalStatementId parameter is not used when constructing the StatementGuid object, then this method will return a statement id where the entity id prefix is normalized to upper case.
 
 equals ( $target)
 
 __toString ()
 

Public Attributes

const SEPARATOR = '$'
 The separator for the prefix and suffix of the GUID.
 

Private Attributes

EntityId $entityId
 
string $guidPart
 
string $serialization
 

Detailed Description

Immutable value object for a statement id.

A statement id consists of the entity id serialization of the entity it belongs to (e.g. "Q1") and a randomly generated global unique identifier (GUID), separated by a dollar sign.

Since
3.0
Author
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\DataModel\Statement\StatementGuid::__construct ( EntityId $entityId,
string $guidPart,
string $originalStatementId = null )
Parameters
EntityId$entityIdthe normalized entity id
string$guidPartthe guid part of the statement id that appears after the separator
string | null$originalStatementIdthe original, non-normalized, statement id. Defaults to null for compatability.

Member Function Documentation

◆ __toString()

Wikibase\DataModel\Statement\StatementGuid::__toString ( )

◆ equals()

Wikibase\DataModel\Statement\StatementGuid::equals ( $target)
Parameters
mixed$target

◆ getEntityId()

Wikibase\DataModel\Statement\StatementGuid::getEntityId ( )

◆ getGuidPart()

Wikibase\DataModel\Statement\StatementGuid::getGuidPart ( )
Since
9.4

◆ getSerialization()

Wikibase\DataModel\Statement\StatementGuid::getSerialization ( )

If the $originalStatementId parameter is not used when constructing the StatementGuid object, then this method will return a statement id where the entity id prefix is normalized to upper case.

This could cause issues when comparing to other statement id serializations, e.g. to look up a statement in a StatementList.

Member Data Documentation

◆ $entityId

EntityId Wikibase\DataModel\Statement\StatementGuid::$entityId
private

◆ $guidPart

string Wikibase\DataModel\Statement\StatementGuid::$guidPart
private

◆ $serialization

string Wikibase\DataModel\Statement\StatementGuid::$serialization
private

◆ SEPARATOR

const Wikibase\DataModel\Statement\StatementGuid::SEPARATOR = '$'

The separator for the prefix and suffix of the GUID.


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