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

This implementation of the UsageAccumulator interface acts as a wrapper around a ParserOutput object. More...

+ Inheritance diagram for Wikibase\Client\Usage\ParserOutputUsageAccumulator:
+ Collaboration diagram for Wikibase\Client\Usage\ParserOutputUsageAccumulator:

Public Member Functions

 __construct (ParserOutputProvider $parserOutputProvider, EntityUsageFactory $entityUsageFactory, UsageDeduplicator $deduplicator)
 
 addUsage (EntityUsage $usage)
 
 getUsages ()
 
- Public Member Functions inherited from Wikibase\Client\Usage\UsageAccumulator
 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).
 
 addOtherUsage (EntityId $id)
 Registers the usage of other (i.e.
 
 addAllUsage (EntityId $id)
 Registers the usage of any/all data of an entity (e.g.
 

Public Attributes

const EXTENSION_DATA_KEY = 'wikibase-entity-usage'
 

Private Member Functions

 getParserOutput ()
 

Private Attributes

EntityUsageFactory $entityUsageFactory
 
UsageDeduplicator $usageDeduplicator
 
ParserOutputProvider $parserOutputProvider
 

Detailed Description

This implementation of the UsageAccumulator interface acts as a wrapper around a ParserOutput object.

Thus, this class encapsulates the knowledge about how usage is tracked in the ParserOutput.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Usage\ParserOutputUsageAccumulator::__construct ( ParserOutputProvider $parserOutputProvider,
EntityUsageFactory $entityUsageFactory,
UsageDeduplicator $deduplicator )

Member Function Documentation

◆ addUsage()

Wikibase\Client\Usage\ParserOutputUsageAccumulator::addUsage ( EntityUsage $usage)
See also
UsageAccumulator::addUsage

Reimplemented from Wikibase\Client\Usage\UsageAccumulator.

◆ getParserOutput()

Wikibase\Client\Usage\ParserOutputUsageAccumulator::getParserOutput ( )
private

◆ getUsages()

Wikibase\Client\Usage\ParserOutputUsageAccumulator::getUsages ( )
See also
UsageAccumulator::getUsage
Returns
EntityUsage[]

Reimplemented from Wikibase\Client\Usage\UsageAccumulator.

Member Data Documentation

◆ $entityUsageFactory

EntityUsageFactory Wikibase\Client\Usage\ParserOutputUsageAccumulator::$entityUsageFactory
private

◆ $parserOutputProvider

ParserOutputProvider Wikibase\Client\Usage\ParserOutputUsageAccumulator::$parserOutputProvider
private

◆ $usageDeduplicator

UsageDeduplicator Wikibase\Client\Usage\ParserOutputUsageAccumulator::$usageDeduplicator
private

◆ EXTENSION_DATA_KEY

const Wikibase\Client\Usage\ParserOutputUsageAccumulator::EXTENSION_DATA_KEY = 'wikibase-entity-usage'

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