Wikibase
MediaWiki Wikibase extension
Wikibase\DataModel\Statement\StatementGuid Class Reference

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

Public Member Functions

 __construct (EntityId $entityId, $guid)
 
 getEntityId ()
 
 getGuidPart ()
 
 getSerialization ()
 
 equals ( $target)
 
 __toString ()
 

Public Attributes

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

Private Attributes

 $entityId
 
 $guidPart
 
 $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,
  $guid 
)
Parameters
EntityId$entityId
string$guid
Exceptions
InvalidArgumentException

Member Function Documentation

◆ __toString()

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

◆ equals()

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

◆ getEntityId()

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

◆ getGuidPart()

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

◆ getSerialization()

Wikibase\DataModel\Statement\StatementGuid::getSerialization ( )
Returns
string
Deprecated:
The value returned by this method might differ in case from the original, unparsed statement GUID (the entity ID part might have been lowercase originally, but is always normalized in the return value here), which means that the value should not be compared to other statement GUID serializations, e.g. to look up a statement in a StatementList.

Member Data Documentation

◆ $entityId

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

◆ $guidPart

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

◆ $serialization

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: