MediaWiki  master
Revision\ContributionsSegment Class Reference

@newable More...

Collaboration diagram for Revision\ContributionsSegment:

Public Member Functions

 __construct (array $revisions, array $tags, ?string $before, ?string $after, array $deltas=[], array $flags=[])
 ContributionsSegment constructor. More...
 
 getAfter ()
 
 getBefore ()
 
 getDeltaForRevision (int $revid)
 Returns the difference in size of the given revision and its parent revision. More...
 
 getRevisions ()
 
 getTagsForRevision ( $revId)
 Returns an associative array mapping revision IDs to lists of tag names. 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 9 of file ContributionsSegment.php.

Constructor & Destructor Documentation

◆ __construct()

Revision\ContributionsSegment::__construct ( array  $revisions,
array  $tags,
?string  $before,
?string  $after,
array  $deltas = [],
array  $flags = [] 
)

ContributionsSegment constructor.

Parameters
RevisionRecord[]$revisions
string[][]$tagsAn associative array mapping revision IDs to lists of tag names.
string | null$before
string | null$after
array$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 Revision\ContributionsSegment\$after, Revision\ContributionsSegment\$before, Revision\ContributionsSegment\$deltas, Revision\ContributionsSegment\$flags, Revision\ContributionsSegment\$revisions, and Revision\ContributionsSegment\$tags.

Member Function Documentation

◆ getAfter()

Revision\ContributionsSegment::getAfter ( )

◆ getBefore()

Revision\ContributionsSegment::getBefore ( )

◆ getDeltaForRevision()

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()

Revision\ContributionsSegment::getRevisions ( )

◆ getTagsForRevision()

Revision\ContributionsSegment::getTagsForRevision (   $revId)

Returns an associative array mapping revision IDs to lists of tag names.

Parameters
int$revIda revision ID
Returns
string[]

Definition at line 77 of file ContributionsSegment.php.

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

◆ isNewest()

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()

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 Revision\ContributionsSegment::$after
private

◆ $before

string null Revision\ContributionsSegment::$before
private

◆ $deltas

array Revision\ContributionsSegment::$deltas
private

Definition at line 34 of file ContributionsSegment.php.

Referenced by Revision\ContributionsSegment\__construct().

◆ $flags

array Revision\ContributionsSegment::$flags
private

Definition at line 39 of file ContributionsSegment.php.

Referenced by Revision\ContributionsSegment\__construct().

◆ $revisions

RevisionRecord [] Revision\ContributionsSegment::$revisions
private

◆ $tags

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

Definition at line 19 of file ContributionsSegment.php.

Referenced by Revision\ContributionsSegment\__construct().


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