MediaWiki master
MediaWiki\Edit\ParsoidRenderID Class Reference

Represents the identity of a specific rendering of a specific revision at some point in time. More...

Inherits Stringable.

Collaboration diagram for MediaWiki\Edit\ParsoidRenderID:

Public Member Functions

 __construct (int $revisionID, string $uniqueID)
 
 __toString ()
 
 getKey ()
 This returns the canonical string representation from the parsoid render ID which can be used to in newFromString().
 
 getRevisionID ()
 Get the revision ID from the parsoid render ID object.
 
 getUniqueID ()
 Get the unique identifier from the parsoid render ID object.
 

Static Public Member Functions

static newFromETag (string $eTag)
 This constructs a new render ID from the given ETag.
 
static newFromKey (string $key)
 
static newFromParserOutput (ParserOutput $parserOutput)
 Create a ParsoidRenderID from the revision and render id stored in a ParserOutput.
 

Detailed Description

Represents the identity of a specific rendering of a specific revision at some point in time.

Since
1.39
Stability: unstable
since 1.39, should be stable by 1.39 release.

Definition at line 16 of file ParsoidRenderID.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Edit\ParsoidRenderID::__construct ( int $revisionID,
string $uniqueID )
Parameters
int$revisionIDRevision that was rendered
string$uniqueIDAn identifier for a point in time.

Definition at line 25 of file ParsoidRenderID.php.

Member Function Documentation

◆ __toString()

MediaWiki\Edit\ParsoidRenderID::__toString ( )

Definition at line 101 of file ParsoidRenderID.php.

◆ getKey()

MediaWiki\Edit\ParsoidRenderID::getKey ( )

This returns the canonical string representation from the parsoid render ID which can be used to in newFromString().

Returns
string

Definition at line 97 of file ParsoidRenderID.php.

◆ getRevisionID()

MediaWiki\Edit\ParsoidRenderID::getRevisionID ( )

Get the revision ID from the parsoid render ID object.

Returns
int

Definition at line 110 of file ParsoidRenderID.php.

◆ getUniqueID()

MediaWiki\Edit\ParsoidRenderID::getUniqueID ( )

Get the unique identifier from the parsoid render ID object.

Returns
string

Definition at line 119 of file ParsoidRenderID.php.

◆ newFromETag()

static MediaWiki\Edit\ParsoidRenderID::newFromETag ( string $eTag)
static

This constructs a new render ID from the given ETag.

Any suffix after a second forward slash will be ignored e.g. ->newFromEtag( '1/abc/stash' ) will return '1/abc' when ->getKey() is called on the ParsoidRenderID object instance.

Parameters
string$eTagETag with double quotes, see https://www.rfc-editor.org/rfc/rfc7232#section-2.3
Returns
ParsoidRenderID|null The render ID embedded in the ETag, or null if the ETag was malformed.
See also
newFromKey() if ETag already has outside quotes trimmed

Definition at line 81 of file ParsoidRenderID.php.

◆ newFromKey()

static MediaWiki\Edit\ParsoidRenderID::newFromKey ( string $key)
static
Parameters
string$keyString representation of render ID (synonymous with an etag with double quotes) as returned by ::getKey().
Returns
self
See also
newFromETag()

Definition at line 39 of file ParsoidRenderID.php.

◆ newFromParserOutput()

static MediaWiki\Edit\ParsoidRenderID::newFromParserOutput ( ParserOutput $parserOutput)
static

Create a ParsoidRenderID from the revision and render id stored in a ParserOutput.

Parameters
ParserOutput$parserOutput
Returns
self

Definition at line 55 of file ParsoidRenderID.php.


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