Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Usage\UsageTracker Interface Reference

Service interface for tracking the usage of entities across pages on the local wiki. More...

+ Inheritance diagram for Wikibase\Client\Usage\UsageTracker:

Public Member Functions

 addUsedEntities ( $pageId, array $usages)
 Adds new entity usage information for the given page.
 
 replaceUsedEntities ( $pageId, array $usages)
 Replaces entity usage information for the given page.
 
 pruneUsages ( $pageId)
 Removes all usage tracking entries for a given page.
 

Detailed Description

Service interface for tracking the usage of entities across pages on the local wiki.

See also
docs/usagetracking.wiki
Author
Daniel Kinzler
Marius Hoch

Member Function Documentation

◆ addUsedEntities()

Wikibase\Client\Usage\UsageTracker::addUsedEntities (   $pageId,
array  $usages 
)

Adds new entity usage information for the given page.

New usage records are added, but old ones are not removed.

Parameters
int$pageIdThe ID of the page the entities are used on.
EntityUsage[]$usagesA list of entity usages.
See also
md_docs_topics_usagetracking for details.
Exceptions
UsageTrackerException

Implemented in Wikibase\Client\Usage\NullUsageTracker, and Wikibase\Client\Usage\Sql\SqlUsageTracker.

◆ pruneUsages()

Wikibase\Client\Usage\UsageTracker::pruneUsages (   $pageId)

Removes all usage tracking entries for a given page.

Parameters
int$pageId
Exceptions
UsageTrackerException
Returns
EntityUsage[] the pruned usages

Implemented in Wikibase\Client\Usage\NullUsageTracker, and Wikibase\Client\Usage\Sql\SqlUsageTracker.

◆ replaceUsedEntities()

Wikibase\Client\Usage\UsageTracker::replaceUsedEntities (   $pageId,
array  $usages 
)

Replaces entity usage information for the given page.

All usages not present in $usages will be removed.

Parameters
int$pageIdThe ID of the page the entities are used on.
EntityUsage[]$usagesA list of entity usages.
See also
md_docs_topics_usagetracking for details.
Exceptions
UsageTrackerException
Returns
EntityUsage[] Usages that have been removed

Implemented in Wikibase\Client\Usage\NullUsageTracker, and Wikibase\Client\Usage\Sql\SqlUsageTracker.


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