Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\Usage\UsageAccumulator Class Reference

Interface and base class for objects accumulating usage tracking information for a given page. More...

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

Public Member Functions

 addUsage (EntityUsage $usage)
 Registers usage of the given aspect of the given entity.
 
 addLabelUsage (EntityId $id, ?string $languageCode=null)
 Registers the usage of an entity's label (in the given language).
 
 addDescriptionUsage (EntityId $id, ?string $languageCode=null)
 Registers the usage of an entity's description (in the given language).
 
 addTitleUsage (EntityId $id)
 Registers the usage of an entity's local page title, i.e.
 
 addSiteLinksUsage (EntityId $id)
 Registers the usage of an entity's sitelinks, e.g.
 
 addStatementUsage (EntityId $id, NumericPropertyId $propertyId)
 Registers the usage of statements from an entity (identified by their property id).
 
 addStatementWithQualOrRefUsage (EntityId $id, NumericPropertyId $propertyId)
 Registers the usage of statements from an entity (identified by their property id) when qualifiers or references are also accessed.
 
 addAliasUsage (EntityId $id, ?string $languageCode=null)
 Registers the usage of an entity's aliases (in the given language).
 
 addOtherUsage (EntityId $id)
 Registers the usage of “other” aspects of an entity (see EntityUsage::OTHER_USAGE for details).
 
 addAllUsage (EntityId $id)
 Please do not add new usages of "all'("X") aspects.
 
 getUsages ()
 Returns all entity usages previously registered via addXxxUsage()
 

Detailed Description

Interface and base class for objects accumulating usage tracking information for a given page.

Author
Daniel Kinzler
Thiemo Kreuz

Member Function Documentation

◆ addAliasUsage()

Wikibase\Client\Usage\UsageAccumulator::addAliasUsage ( EntityId $id,
?string $languageCode = null )

Registers the usage of an entity's aliases (in the given language).

◆ addAllUsage()

Wikibase\Client\Usage\UsageAccumulator::addAllUsage ( EntityId $id)

Please do not add new usages of "all'("X") aspects.

This places too much pressure on client recentchanges tables and causes unnecessary reparses. The method only remains to monitor redirect pages

See also
WikibaseLanguageIndependentLuaBindings.php line 328 for an example of this.

Registers the usage of any/all data of an entity (e.g. when accessed programmatically using Lua).

◆ addDescriptionUsage()

Wikibase\Client\Usage\UsageAccumulator::addDescriptionUsage ( EntityId $id,
?string $languageCode = null )

Registers the usage of an entity's description (in the given language).

◆ addLabelUsage()

Wikibase\Client\Usage\UsageAccumulator::addLabelUsage ( EntityId $id,
?string $languageCode = null )

Registers the usage of an entity's label (in the given language).

◆ addOtherUsage()

Wikibase\Client\Usage\UsageAccumulator::addOtherUsage ( EntityId $id)

Registers the usage of “other” aspects of an entity (see EntityUsage::OTHER_USAGE for details).

◆ addSiteLinksUsage()

Wikibase\Client\Usage\UsageAccumulator::addSiteLinksUsage ( EntityId $id)

Registers the usage of an entity's sitelinks, e.g.

to generate language links.

◆ addStatementUsage()

Wikibase\Client\Usage\UsageAccumulator::addStatementUsage ( EntityId $id,
NumericPropertyId $propertyId )

Registers the usage of statements from an entity (identified by their property id).

Parameters
EntityId$id
NumericPropertyId$propertyIdThe NumericPropertyId of Statements that are used.

◆ addStatementWithQualOrRefUsage()

Wikibase\Client\Usage\UsageAccumulator::addStatementWithQualOrRefUsage ( EntityId $id,
NumericPropertyId $propertyId )

Registers the usage of statements from an entity (identified by their property id) when qualifiers or references are also accessed.

Parameters
EntityId$id
NumericPropertyId$propertyIdThe NumericPropertyId of Statements that are used.

◆ addTitleUsage()

Wikibase\Client\Usage\UsageAccumulator::addTitleUsage ( EntityId $id)

Registers the usage of an entity's local page title, i.e.

the title of the local (client) page linked to the entity, e.g. to refer to the corresponding page on the local wiki.

◆ addUsage()

Wikibase\Client\Usage\UsageAccumulator::addUsage ( EntityUsage $usage)
abstract

◆ getUsages()

Wikibase\Client\Usage\UsageAccumulator::getUsages ( )
abstract

Returns all entity usages previously registered via addXxxUsage()

Returns
EntityUsage[]

Reimplemented in Wikibase\Client\Usage\HashUsageAccumulator, Wikibase\Client\Usage\ParserOutputUsageAccumulator, and Wikibase\Client\Usage\RedirectTrackingUsageAccumulator.


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