MediaWiki  master
MediaWiki\Revision\ContributionsSegment Class Reference

@newable More...

Collaboration diagram for MediaWiki\Revision\ContributionsSegment:

Public Member Functions

 __construct (array $revisions, array $tags, ?string $before, ?string $after, array $deltas=[], array $flags=[])
 
 getAfter ()
 
 getBefore ()
 
 getDeltaForRevision (int $revid)
 Returns the difference in size of the given revision and its parent revision. More...
 
 getRevisions ()
 
 getTagsForRevision ( $revId)
 Get tags and associated metadata for a given revision. More...
 
 isNewest ()
 The value of the 'newest' field of the flags passed to the constructor, or false if that field was not set. More...
 
 isOldest ()
 The value of the 'oldest' field of the flags passed to the constructor, or false if that field was not set. More...
 

Private Attributes

string null $after
 
string null $before
 
array $deltas
 
array $flags
 
RevisionRecord[] $revisions
 
string[][] $tags
 

Detailed Description

@newable

Since
1.35

Definition at line 11 of file ContributionsSegment.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Revision\ContributionsSegment::__construct ( array  $revisions,
array  $tags,
?string  $before,
?string  $after,
array  $deltas = [],
array  $flags = [] 
)
Parameters
RevisionRecord[]$revisions
string[][]$tagsAssociative array mapping revision IDs to a map of tag names to Message objects
string | null$before
string | null$after
int[]$deltasAn associative array mapping a revision Id to the difference in size of this revision and its parent revision. Values may be null if the size difference is unknown.
array$flagsIs an associative array, known fields are:
  • newest: bool indicating whether this segment is the newest in time
  • oldest: bool indicating whether this segment is the oldest in time

Definition at line 54 of file ContributionsSegment.php.

References MediaWiki\Revision\ContributionsSegment\$after, MediaWiki\Revision\ContributionsSegment\$before, MediaWiki\Revision\ContributionsSegment\$deltas, MediaWiki\Revision\ContributionsSegment\$flags, MediaWiki\Revision\ContributionsSegment\$revisions, and MediaWiki\Revision\ContributionsSegment\$tags.

Member Function Documentation

◆ getAfter()

MediaWiki\Revision\ContributionsSegment::getAfter ( )

◆ getBefore()

MediaWiki\Revision\ContributionsSegment::getBefore ( )

◆ getDeltaForRevision()

MediaWiki\Revision\ContributionsSegment::getDeltaForRevision ( int  $revid)

Returns the difference in size of the given revision and its parent revision.

Returns null if the size difference is unknown.

Parameters
int$revidRevision id
Returns
int|null

Definition at line 108 of file ContributionsSegment.php.

Referenced by MediaWiki\Rest\Handler\UserContributionsHandler\getContributionsList().

◆ getRevisions()

MediaWiki\Revision\ContributionsSegment::getRevisions ( )

◆ getTagsForRevision()

MediaWiki\Revision\ContributionsSegment::getTagsForRevision (   $revId)

Get tags and associated metadata for a given revision.

Parameters
int$revIda revision ID
Returns
Message[] Associative array mapping tag name to a Message object storing tag display data

Definition at line 77 of file ContributionsSegment.php.

Referenced by MediaWiki\Rest\Handler\UserContributionsHandler\getContributionsList().

◆ isNewest()

MediaWiki\Revision\ContributionsSegment::isNewest ( )

The value of the 'newest' field of the flags passed to the constructor, or false if that field was not set.

Returns
bool

Definition at line 118 of file ContributionsSegment.php.

◆ isOldest()

MediaWiki\Revision\ContributionsSegment::isOldest ( )

The value of the 'oldest' field of the flags passed to the constructor, or false if that field was not set.

Returns
bool

Definition at line 128 of file ContributionsSegment.php.

Referenced by MediaWiki\Rest\Handler\UserContributionsHandler\constructURLs().

Member Data Documentation

◆ $after

string null MediaWiki\Revision\ContributionsSegment::$after
private

◆ $before

string null MediaWiki\Revision\ContributionsSegment::$before
private

◆ $deltas

array MediaWiki\Revision\ContributionsSegment::$deltas
private

◆ $flags

array MediaWiki\Revision\ContributionsSegment::$flags
private

◆ $revisions

RevisionRecord [] MediaWiki\Revision\ContributionsSegment::$revisions
private

◆ $tags

string [][] MediaWiki\Revision\ContributionsSegment::$tags
private

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