Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Store\UsageUpdater Class Reference

Service for updating usage tracking and associated change subscription information. More...

Public Member Functions

 __construct ( $clientId, UsageTracker $usageTracker, UsageLookup $usageLookup, SubscriptionManager $subscriptionManager)
 
 addUsagesForPage ( $pageId, array $usages)
 Adds entity usage information for the given page, and automatically adjusts any subscriptions based on that usage.
 
 replaceUsagesForPage ( $pageId, array $usages)
 Updates entity usage information for the given page, and automatically adjusts any subscriptions based on that usage.
 
 pruneUsagesForPage ( $pageId)
 Removes all usage information for the given page, and removes any subscriptions that have become unnecessary.
 

Private Member Functions

 getEntityIds (array $entityUsages)
 

Private Attributes

 $clientId
 
 $usageTracker
 
 $usageLookup
 
 $subscriptionManager
 

Detailed Description

Service for updating usage tracking and associated change subscription information.

Author
Daniel Kinzler
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Store\UsageUpdater::__construct ( $clientId,
UsageTracker $usageTracker,
UsageLookup $usageLookup,
SubscriptionManager $subscriptionManager )
Parameters
string$clientId
UsageTracker$usageTracker
UsageLookup$usageLookup
SubscriptionManager$subscriptionManager

Member Function Documentation

◆ addUsagesForPage()

Wikibase\Client\Store\UsageUpdater::addUsagesForPage ( $pageId,
array $usages )

Adds entity usage information for the given page, and automatically adjusts any subscriptions based on that usage.

Parameters
int$pageIdThe ID of the page the entities are used on.
EntityUsage[]$usagesA list of EntityUsage objects. See Usage tracking for details.
See also
UsageTracker::trackUsedEntities
Exceptions
InvalidArgumentException

◆ getEntityIds()

Wikibase\Client\Store\UsageUpdater::getEntityIds ( array $entityUsages)
private
Parameters
EntityUsage[]$entityUsages
Returns
EntityId[]

◆ pruneUsagesForPage()

Wikibase\Client\Store\UsageUpdater::pruneUsagesForPage ( $pageId)

Removes all usage information for the given page, and removes any subscriptions that have become unnecessary.

Parameters
int$pageIdThe ID of the page the entities are used on.
See also
UsageTracker::pruneUsages
Exceptions
InvalidArgumentException

◆ replaceUsagesForPage()

Wikibase\Client\Store\UsageUpdater::replaceUsagesForPage ( $pageId,
array $usages )

Updates entity usage information for the given page, and automatically adjusts any subscriptions based on that usage.

Parameters
int$pageIdThe ID of the page the entities are used on.
EntityUsage[]$usagesA list of EntityUsage objects. See Usage tracking for details.
See also
UsageTracker::replaceUsedEntities
Exceptions
InvalidArgumentException

Member Data Documentation

◆ $clientId

Wikibase\Client\Store\UsageUpdater::$clientId
private

◆ $subscriptionManager

Wikibase\Client\Store\UsageUpdater::$subscriptionManager
private

◆ $usageLookup

Wikibase\Client\Store\UsageUpdater::$usageLookup
private

◆ $usageTracker

Wikibase\Client\Store\UsageUpdater::$usageTracker
private

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