MediaWiki  master
Revision\ContributionsLookup Class Reference
Collaboration diagram for Revision\ContributionsLookup:

Public Member Functions

 __construct (RevisionStore $revisionStore)
 ContributionsLookup constructor. More...
 
 getContributionCount (UserIdentity $user, User $performer, $tag=null)
 Returns the number of edits by the given user. More...
 
 getContributions (UserIdentity $target, int $limit, User $performer, string $segment='', string $tag=null)
 

Private Member Functions

 getContributionDeltas ( $revisions)
 Gets size deltas of a revision and its parent revision. More...
 
 getPagerParams (int $limit, string $segment)
 Constructs fake query parameters to be passed to ContribsPager. More...
 

Private Attributes

RevisionStore $revisionStore
 

Detailed Description

Since
1.35

Definition at line 14 of file ContributionsLookup.php.

Constructor & Destructor Documentation

◆ __construct()

Revision\ContributionsLookup::__construct ( RevisionStore  $revisionStore)

ContributionsLookup constructor.

Parameters
RevisionStore$revisionStore

Definition at line 26 of file ContributionsLookup.php.

References Revision\ContributionsLookup\$revisionStore.

Member Function Documentation

◆ getContributionCount()

Revision\ContributionsLookup::getContributionCount ( UserIdentity  $user,
User  $performer,
  $tag = null 
)

Returns the number of edits by the given user.

Parameters
UserIdentity$user
User$performerthe user used for permission checks
string | null$tag
Returns
int

Definition at line 178 of file ContributionsLookup.php.

References MediaWiki\$context.

◆ getContributionDeltas()

Revision\ContributionsLookup::getContributionDeltas (   $revisions)
private

Gets size deltas of a revision and its parent revision.

Parameters
RevisionRecord[]$revisions
Returns
int[] Associative array of revision ids and their deltas. If revision is the first on a page, delta is revision size. If parent revision is unknown, delta is null.

Definition at line 144 of file ContributionsLookup.php.

Referenced by Revision\ContributionsLookup\getContributions().

◆ getContributions()

Revision\ContributionsLookup::getContributions ( UserIdentity  $target,
int  $limit,
User  $performer,
string  $segment = '',
string  $tag = null 
)
Parameters
UserIdentity$targetthe user from whom to retrieve contributions
int$limitthe maximum number of revisions to return
User$performerthe user used for permission checks
string$segment
string | null$tag
Returns
ContributionsSegment
Exceptions

Definition at line 75 of file ContributionsLookup.php.

References MediaWiki\$context, Revision\ContributionsLookup\getContributionDeltas(), and Revision\ContributionsLookup\getPagerParams().

◆ getPagerParams()

Revision\ContributionsLookup::getPagerParams ( int  $limit,
string  $segment 
)
private

Constructs fake query parameters to be passed to ContribsPager.

Parameters
int$limitMaximum number of revisions to return.
string$segmentIndicates which segment of the contributions to return. The segment should consist of 2 parts separated by a pipe character. The first part is mapped to the 'dir' parameter. The second part is mapped to the 'offset' parameter. The value for the offset is opaque and is ultimately supplied by ContribsPager::getPagingQueries().
Returns
array

Definition at line 41 of file ContributionsLookup.php.

Referenced by Revision\ContributionsLookup\getContributions().

Member Data Documentation

◆ $revisionStore

RevisionStore Revision\ContributionsLookup::$revisionStore
private

Definition at line 19 of file ContributionsLookup.php.

Referenced by Revision\ContributionsLookup\__construct().


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