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

Public Member Functions

 __construct (RevisionStore $revisionStore, LinkRendererFactory $linkRendererFactory, LinkBatchFactory $linkBatchFactory, HookContainer $hookContainer, ILoadBalancer $loadBalancer, ActorMigration $actorMigration, NamespaceInfo $namespaceInfo)
 
 getContributionCount (UserIdentity $user, Authority $performer, $tag=null)
 Returns the number of edits by the given user. More...
 
 getContributions (UserIdentity $target, int $limit, Authority $performer, string $segment='', string $tag=null)
 

Private Member Functions

 getContribsPager (IContextSource $context, UserIdentity $targetUser, array $options)
 
 getContributionDeltas ( $revisions)
 Gets size deltas of a revision and its parent revision. More...
 
 getContributionTags (array $tagNames)
 
 getPagerParams (int $limit, string $segment)
 Constructs fake query parameters to be passed to ContribsPager. More...
 

Private Attributes

ActorMigration $actorMigration
 
HookContainer $hookContainer
 
LinkBatchFactory $linkBatchFactory
 
LinkRendererFactory $linkRendererFactory
 
ILoadBalancer $loadBalancer
 
NamespaceInfo $namespaceInfo
 
RevisionStore $revisionStore
 

Detailed Description

Since
1.35

Definition at line 23 of file ContributionsLookup.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Revision\ContributionsLookup::__construct ( RevisionStore  $revisionStore,
LinkRendererFactory  $linkRendererFactory,
LinkBatchFactory  $linkBatchFactory,
HookContainer  $hookContainer,
ILoadBalancer  $loadBalancer,
ActorMigration  $actorMigration,
NamespaceInfo  $namespaceInfo 
)

Member Function Documentation

◆ getContribsPager()

MediaWiki\Revision\ContributionsLookup::getContribsPager ( IContextSource  $context,
UserIdentity  $targetUser,
array  $options 
)
private

◆ getContributionCount()

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

Returns the number of edits by the given user.

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

Definition at line 236 of file ContributionsLookup.php.

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

◆ getContributionDeltas()

MediaWiki\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 202 of file ContributionsLookup.php.

Referenced by MediaWiki\Revision\ContributionsLookup\getContributions().

◆ getContributions()

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

Definition at line 117 of file ContributionsLookup.php.

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

◆ getContributionTags()

MediaWiki\Revision\ContributionsLookup::getContributionTags ( array  $tagNames)
private
Parameters
string[]$tagNamesArray of tag names
Returns
Message[] Associative array mapping tag name to a Message object containing the tag's display value

Definition at line 184 of file ContributionsLookup.php.

References RequestContext\getMain(), and ChangeTags\tagShortDescriptionMessage().

Referenced by MediaWiki\Revision\ContributionsLookup\getContributions().

◆ getPagerParams()

MediaWiki\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 84 of file ContributionsLookup.php.

Referenced by MediaWiki\Revision\ContributionsLookup\getContributions().

Member Data Documentation

◆ $actorMigration

ActorMigration MediaWiki\Revision\ContributionsLookup::$actorMigration
private

◆ $hookContainer

HookContainer MediaWiki\Revision\ContributionsLookup::$hookContainer
private

◆ $linkBatchFactory

LinkBatchFactory MediaWiki\Revision\ContributionsLookup::$linkBatchFactory
private

◆ $linkRendererFactory

LinkRendererFactory MediaWiki\Revision\ContributionsLookup::$linkRendererFactory
private

◆ $loadBalancer

ILoadBalancer MediaWiki\Revision\ContributionsLookup::$loadBalancer
private

◆ $namespaceInfo

NamespaceInfo MediaWiki\Revision\ContributionsLookup::$namespaceInfo
private

◆ $revisionStore

RevisionStore MediaWiki\Revision\ContributionsLookup::$revisionStore
private

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