Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\EntityRevision Class Reference

An EntityRevision contains a specific revision of an EntityDocument. More...

Public Member Functions

 __construct (EntityDocument $entity, $revisionId=self::UNSAVED_REVISION, $mwTimestamp='')
 
 getEntity ()
 
 getRevisionId ()
 The ID of the revision of the given entity.
 
 getTimestamp ()
 The revision's timestamp.
 

Public Attributes

const UNSAVED_REVISION = 0
 

Private Attributes

 $entity
 
 $revisionId
 
 $mwTimestamp
 

Detailed Description

An EntityRevision contains a specific revision of an EntityDocument.

A revision of an entity is uniquely identified by the tuple ( entity ID, revision ID ).

Note that the revision ID alone cannot be relied upon to identify an entity. Revisions of two different entities may have the same revision ID. For more information on the relationship between entities and wiki pages, see docs/entity-storage.wiki.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\EntityRevision::__construct ( EntityDocument  $entity,
  $revisionId = self::UNSAVED_REVISION,
  $mwTimestamp = '' 
)
Parameters
EntityDocument$entity
int$revisionIdRevision ID or 0 for none
string$mwTimestampin MediaWiki format or an empty string for none
Exceptions
InvalidArgumentException

Member Function Documentation

◆ getEntity()

Wikibase\Lib\Store\EntityRevision::getEntity ( )
Returns
EntityDocument

◆ getRevisionId()

Wikibase\Lib\Store\EntityRevision::getRevisionId ( )

The ID of the revision of the given entity.

Note that this number is not guaranteed to be globally unique, nor to be increasing over time.

Returns
int

◆ getTimestamp()

Wikibase\Lib\Store\EntityRevision::getTimestamp ( )

The revision's timestamp.

This is purely informational, it does not identify the revision.

Returns
string in MediaWiki format or an empty string

Member Data Documentation

◆ $entity

Wikibase\Lib\Store\EntityRevision::$entity
private

◆ $mwTimestamp

Wikibase\Lib\Store\EntityRevision::$mwTimestamp
private

◆ $revisionId

Wikibase\Lib\Store\EntityRevision::$revisionId
private

◆ UNSAVED_REVISION

const Wikibase\Lib\Store\EntityRevision::UNSAVED_REVISION = 0

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