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

This class de-duplicates entity usages for performance and storage reasons. More...

Public Member Functions

 __construct (array $usageModifierLimits)
 
 deduplicate (array $usages)
 

Private Member Functions

 structureUsages (array $usages)
 
 deduplicateStructuredUsages (array $structuredUsages)
 
 limitPerAspect ( $aspect, array &$usages)
 
 deduplicatePerAspect (array &$usages)
 
 flattenStructuredUsages (array $structuredUsages)
 

Private Attributes

 $usageModifierLimits
 

Detailed Description

This class de-duplicates entity usages for performance and storage reasons.

Author
Amir Sarabadani

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\Usage\UsageDeduplicator::__construct ( array  $usageModifierLimits)
Parameters
int[]$usageModifierLimitsassociative array mapping usage type to the limit

Member Function Documentation

◆ deduplicate()

Wikibase\Client\Usage\UsageDeduplicator::deduplicate ( array  $usages)
Parameters
EntityUsage[]$usages
Returns
EntityUsage[]

◆ deduplicatePerAspect()

Wikibase\Client\Usage\UsageDeduplicator::deduplicatePerAspect ( array &  $usages)
private
Parameters
EntityUsage[]&$usages

◆ deduplicateStructuredUsages()

Wikibase\Client\Usage\UsageDeduplicator::deduplicateStructuredUsages ( array  $structuredUsages)
private
Parameters
array[][]$structuredUsages
Returns
array[]

◆ flattenStructuredUsages()

Wikibase\Client\Usage\UsageDeduplicator::flattenStructuredUsages ( array  $structuredUsages)
private
Parameters
array[]$structuredUsages
Returns
EntityUsage[]

◆ limitPerAspect()

Wikibase\Client\Usage\UsageDeduplicator::limitPerAspect (   $aspect,
array &  $usages 
)
private
Parameters
string$aspect
EntityUsage[]&$usages

◆ structureUsages()

Wikibase\Client\Usage\UsageDeduplicator::structureUsages ( array  $usages)
private
Parameters
EntityUsage[]$usages
Returns
array[][] three-dimensional array of [ $entityId => [ $aspectKey => [ EntityUsage $usage, … ], … ], … ]

Member Data Documentation

◆ $usageModifierLimits

Wikibase\Client\Usage\UsageDeduplicator::$usageModifierLimits
private

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