Wikibase
MediaWiki Wikibase extension
Wikibase\Client\RecentChanges\RecentChangeFactory Class Reference

Public Member Functions

 __construct (Language $language, SiteLinkCommentCreator $siteLinkCommentCreator, CentralIdLookup $centralIdLookup=null, ExternalUserNames $externalUsernames=null)
 
 newRecentChange (EntityChange $change, Title $target, array $preparedAttribs=null)
 Creates a local RecentChange object that corresponds to the EntityChange from the repo, with respect to the given target page. More...
 
 prepareChangeAttributes (EntityChange $change)
 Prepare change attributes for the given EntityChange. More...
 

Static Public Member Functions

static isWikibaseChange (RecentChange $rc)
 

Public Attributes

const SRC_WIKIBASE = 'wb'
 Classification of Wikibase changes in the rc_source column of the recentchanges table. More...
 

Private Member Functions

 getClientUserId ( $repoUserId, array $metadata)
 Gets the client's user ID from the repo user ID and EntityChange's metadata. More...
 
 buildTargetSpecificAttributes (EntityChange $change, Title $target)
 Builds change attribute specific to the given target page. More...
 
 buildTargetSpecificComment (EntityChange $change, Title $target)
 Get a title specific rc_comment, in case that is needed. More...
 
 getEditCommentMulti (EntityChange $change, Title $target=null)
 Returns a human readable comment representing the given changes. More...
 
 getEditComment (EntityChange $change, Title $target=null)
 Returns a human readable comment representing the change. More...
 
 msg ( $key,... $params)
 

Private Attributes

 $language
 
 $siteLinkCommentCreator
 
 $centralIdLookup
 
 $externalUsernames
 

Detailed Description

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\RecentChanges\RecentChangeFactory::__construct ( Language  $language,
SiteLinkCommentCreator  $siteLinkCommentCreator,
CentralIdLookup  $centralIdLookup = null,
ExternalUserNames  $externalUsernames = null 
)
Parameters
Language$languageLanguage to format in
SiteLinkCommentCreator$siteLinkCommentCreator
CentralIdLookup | null$centralIdLookupCentralIdLookup, or null if this repository is not connected to a central user system (see CentralIdLookup::factoryNonLocal).
ExternalUserNames | null$externalUsernames

Member Function Documentation

◆ buildTargetSpecificAttributes()

Wikibase\Client\RecentChanges\RecentChangeFactory::buildTargetSpecificAttributes ( EntityChange  $change,
Title  $target 
)
private

Builds change attribute specific to the given target page.

Parameters
EntityChange$change
Title$target
Returns
array

◆ buildTargetSpecificComment()

Wikibase\Client\RecentChanges\RecentChangeFactory::buildTargetSpecificComment ( EntityChange  $change,
Title  $target 
)
private

Get a title specific rc_comment, in case that is needed.

Null otherwise.

Parameters
EntityChange$change
Title$target
Returns
string|null

◆ getClientUserId()

Wikibase\Client\RecentChanges\RecentChangeFactory::getClientUserId (   $repoUserId,
array  $metadata 
)
private

Gets the client's user ID from the repo user ID and EntityChange's metadata.

Parameters
int$repoUserIdOriginal user ID from the repository
array$metadataEntityChange metadata
Returns
int User ID for the current (client) wiki

◆ getEditComment()

Wikibase\Client\RecentChanges\RecentChangeFactory::getEditComment ( EntityChange  $change,
Title  $target = null 
)
private

Returns a human readable comment representing the change.

Parameters
EntityChange$changethe change to get a comment for
Title | null$targetThe page we create an edit summary for. Needed to create an article specific edit summary on site link changes. Ignored otherwise.
Exceptions
MWException
Returns
string

◆ getEditCommentMulti()

Wikibase\Client\RecentChanges\RecentChangeFactory::getEditCommentMulti ( EntityChange  $change,
Title  $target = null 
)
private

Returns a human readable comment representing the given changes.

Parameters
EntityChange$change
Title | null$targetThe page we create an edit summary for. Needed to create an article specific edit summary on site link changes. Ignored otherwise.
Exceptions
MWException
Returns
string

◆ isWikibaseChange()

static Wikibase\Client\RecentChanges\RecentChangeFactory::isWikibaseChange ( RecentChange  $rc)
static
Parameters
RecentChange$rc
Returns
bool

◆ msg()

Wikibase\Client\RecentChanges\RecentChangeFactory::msg (   $key,
  $params 
)
private
Parameters
string$key
Returns
Message
Exceptions
MWException

◆ newRecentChange()

Wikibase\Client\RecentChanges\RecentChangeFactory::newRecentChange ( EntityChange  $change,
Title  $target,
array  $preparedAttribs = null 
)

Creates a local RecentChange object that corresponds to the EntityChange from the repo, with respect to the given target page.

Parameters
EntityChange$changeA change reported from the wikibase repository
Title$targetThe title of a page affected by the change
array | null$preparedAttribsAttributes pre-calculated by calling prepareChangeAttributes() to avoid re-calculating common change attributes for each target page.
Returns
RecentChange

◆ prepareChangeAttributes()

Wikibase\Client\RecentChanges\RecentChangeFactory::prepareChangeAttributes ( EntityChange  $change)

Prepare change attributes for the given EntityChange.

This can be used to avoid re-calculating these attributes for each target page, when processing a change with respect to a batch of affected target pages.

Parameters
EntityChange$change
Returns
array Associative array of prepared change attributes, for use with the $preparedAttribs of newRecentChange().

Member Data Documentation

◆ $centralIdLookup

Wikibase\Client\RecentChanges\RecentChangeFactory::$centralIdLookup
private

◆ $externalUsernames

Wikibase\Client\RecentChanges\RecentChangeFactory::$externalUsernames
private

◆ $language

Wikibase\Client\RecentChanges\RecentChangeFactory::$language
private

◆ $siteLinkCommentCreator

Wikibase\Client\RecentChanges\RecentChangeFactory::$siteLinkCommentCreator
private

◆ SRC_WIKIBASE

const Wikibase\Client\RecentChanges\RecentChangeFactory::SRC_WIKIBASE = 'wb'

Classification of Wikibase changes in the rc_source column of the recentchanges table.


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