MediaWiki REL1_35
MediaWiki\Rest\Handler\UserContributionsHandler Class Reference
Inheritance diagram for MediaWiki\Rest\Handler\UserContributionsHandler:
Collaboration diagram for MediaWiki\Rest\Handler\UserContributionsHandler:

Public Member Functions

 __construct (ContributionsLookup $contributionsLookup, UserFactory $userFactory, UserNameUtils $userNameUtils)
 
 execute ()
 
 getParamSettings ()
 Fetch ParamValidator settings for parameters.
 
- Public Member Functions inherited from MediaWiki\Rest\Handler
 applyConditionalResponseHeaders (ResponseInterface $response)
 Modify the response, adding Last-Modified and ETag headers as indicated the values previously returned by ETag and getLastModified().
 
 checkPreconditions ()
 Check the conditional request headers and generate a response if appropriate.
 
 getBodyValidator ( $contentType)
 Fetch the BodyValidator.
 
 getConfig ()
 Get the configuration array for the current route.
 
 getRequest ()
 Get the current request.
 
 getResponseFactory ()
 Get the ResponseFactory which can be used to generate Response objects.
 
 getValidatedBody ()
 Fetch the validated body.
 
 getValidatedParams ()
 Fetch the validated parameters.
 
 init (Router $router, RequestInterface $request, array $config, ResponseFactory $responseFactory, HookContainer $hookContainer)
 Initialise with dependencies from the Router.
 
 needsReadAccess ()
 Indicates whether this route requires read rights.
 
 needsWriteAccess ()
 Indicates whether this route requires write access.
 
 validate (Validator $restValidator)
 Validate the request parameters/attributes and body.
 

Protected Member Functions

 postInitSetup ()
 The handler can override this to do any necessary setup after init() is called to inject the dependencies.
 
- Protected Member Functions inherited from MediaWiki\Rest\Handler
 getConditionalHeaderUtil ()
 Get a ConditionalHeaderUtil object.
 
 getETag ()
 The subclass should override this to provide an ETag for the current request.
 
 getHookContainer ()
 Get a HookContainer, for running extension hooks or for hook metadata.
 
 getHookRunner ()
 Get a HookRunner for running core hooks.
 
 getLastModified ()
 The subclass should override this to provide the maximum last modified timestamp for the current request.
 
 getRouter ()
 Get the Router.
 
 getRouteUrl ( $pathParams=[], $queryParams=[])
 Get the URL of this handler's endpoint.
 
 hasRepresentation ()
 The subclass should override this to indicate whether the resource exists.
 
 urlEncodeTitle ( $title)
 URL-encode titles in a "pretty" way.
 

Private Member Functions

 constructURLs (ContributionsSegment $segment)
 
 getRevisionsList (ContributionsSegment $segment)
 Returns list of revisions.
 
 getTargetUser ()
 Returns the user who's contributions we are requesting.
 

Private Attributes

ContributionsLookup $contributionsLookup
 
bool $me
 User is requesting their own contributions.
 
UserFactory $userFactory
 
UserNameUtils $userNameUtils
 
const MAX_LIMIT = 20
 Hard limit results to 20 revisions.
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Rest\Handler
const PARAM_SOURCE = 'rest-param-source'
 (string) ParamValidator constant to specify the source of the parameter.
 

Detailed Description

Since
1.35

Definition at line 23 of file UserContributionsHandler.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\Handler\UserContributionsHandler::__construct ( ContributionsLookup  $contributionsLookup,
UserFactory  $userFactory,
UserNameUtils  $userNameUtils 
)
Parameters
ContributionsLookup$contributionsLookup
UserFactory$userFactory
UserNameUtils$userNameUtils

Definition at line 53 of file UserContributionsHandler.php.

References MediaWiki\Rest\Handler\UserContributionsHandler\$contributionsLookup, MediaWiki\Rest\Handler\UserContributionsHandler\$userFactory, and MediaWiki\Rest\Handler\UserContributionsHandler\$userNameUtils.

Member Function Documentation

◆ constructURLs()

◆ execute()

MediaWiki\Rest\Handler\UserContributionsHandler::execute ( )

◆ getParamSettings()

MediaWiki\Rest\Handler\UserContributionsHandler::getParamSettings ( )

Fetch ParamValidator settings for parameters.

Every setting must include self::PARAM_SOURCE to specify which part of the request is to contain the parameter.

Stable to override

Returns
array[] Associative array mapping parameter names to ParamValidator settings arrays

Reimplemented from MediaWiki\Rest\Handler.

Definition at line 188 of file UserContributionsHandler.php.

◆ getRevisionsList()

MediaWiki\Rest\Handler\UserContributionsHandler::getRevisionsList ( ContributionsSegment  $segment)
private

Returns list of revisions.

Parameters
ContributionsSegment$segment
Returns
array[]

Definition at line 143 of file UserContributionsHandler.php.

References MediaWiki\Revision\ContributionsSegment\getDeltaForRevision(), MediaWiki\Revision\ContributionsSegment\getTagsForRevision(), and wfTimestamp().

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

◆ getTargetUser()

MediaWiki\Rest\Handler\UserContributionsHandler::getTargetUser ( )
private

Returns the user who's contributions we are requesting.

Either me (requesting user) or another user.

Returns
UserIdentity
Exceptions
LocalizedHttpException

Definition at line 74 of file UserContributionsHandler.php.

References MediaWiki\Rest\Handler\getValidatedParams().

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

◆ postInitSetup()

MediaWiki\Rest\Handler\UserContributionsHandler::postInitSetup ( )
protected

The handler can override this to do any necessary setup after init() is called to inject the dependencies.

Stable to override

Reimplemented from MediaWiki\Rest\Handler.

Definition at line 63 of file UserContributionsHandler.php.

References MediaWiki\Rest\Handler\getConfig().

Member Data Documentation

◆ $contributionsLookup

ContributionsLookup MediaWiki\Rest\Handler\UserContributionsHandler::$contributionsLookup
private

◆ $me

bool MediaWiki\Rest\Handler\UserContributionsHandler::$me
private

User is requesting their own contributions.

Definition at line 41 of file UserContributionsHandler.php.

◆ $userFactory

UserFactory MediaWiki\Rest\Handler\UserContributionsHandler::$userFactory
private

◆ $userNameUtils

UserNameUtils MediaWiki\Rest\Handler\UserContributionsHandler::$userNameUtils
private

◆ MAX_LIMIT

const MediaWiki\Rest\Handler\UserContributionsHandler::MAX_LIMIT = 20
private

Hard limit results to 20 revisions.

Definition at line 36 of file UserContributionsHandler.php.


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