Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\RecentChanges\RecentChangeFactory Class Reference

Public Member Functions

 __construct (Language $language, SiteLinkCommentCreator $siteLinkCommentCreator, EntitySourceDefinitions $entitySourceDefinitions, ClientDomainDb $clientDomainDb, 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.
 
 prepareChangeAttributes (EntityChange $change)
 Prepare change attributes for the given EntityChange.
 

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.
 

Private Member Functions

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

Private Attributes

 $language
 
 $siteLinkCommentCreator
 
 $entitySourceDefinitions
 
 $localDomainId
 
 $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,
EntitySourceDefinitions $entitySourceDefinitions,
ClientDomainDb $clientDomainDb,
CentralIdLookup $centralIdLookup = null,
ExternalUserNames $externalUsernames = null )
Parameters
Language$languageLanguage to format in
SiteLinkCommentCreator$siteLinkCommentCreator
EntitySourceDefinitions$entitySourceDefinitions
ClientDomainDb$clientDomainDb
CentralIdLookup | null$centralIdLookupCentralIdLookup, or null if this repository is not connected to a central user system (see CentralIdLookupFactory::getNonLocalLookup).
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,
bool $changeComesFromLocalDb )
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
bool$changeComesFromLocalDb
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.
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.
Returns
string

◆ isChangeFromLocalDb()

Wikibase\Client\RecentChanges\RecentChangeFactory::isChangeFromLocalDb ( EntityChange $change)
private

◆ 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

◆ 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

◆ $entitySourceDefinitions

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

◆ $externalUsernames

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

◆ $language

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

◆ $localDomainId

Wikibase\Client\RecentChanges\RecentChangeFactory::$localDomainId
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: