Wikibase
MediaWiki Wikibase extension
Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings Class Reference

Actual implementations of the functions to access Wikibase through the Scribunto extension. More...

Public Member Functions

 __construct (StatementTransclusionInteractor $plainTextTransclusionInteractor, StatementTransclusionInteractor $richWikitextTransclusionInteractor, EntityIdParser $entityIdParser, Language $language, UsageAccumulator $usageAccumulator, $siteId)
 
 formatPropertyValues ( $entityId, $propertyLabelOrId, array $acceptableRanks=null)
 Format the main Snaks belonging to a Statement (which is identified by a PropertyId or the label of a Property) as wikitext escaped plain text. More...
 
 formatStatements ( $entityId, $propertyLabelOrId, array $acceptableRanks=null)
 Format the main Snaks belonging to a Statement (which is identified by a PropertyId or the label of a Property) as rich wikitext. More...
 
 addStatementUsage ( $entityId, $propertyId)
 Add a statement usage (called once specific statements are accessed). More...
 
 addLabelUsage ( $entityId, $langCode)
 Add a label usage (called once specific labels are accessed). More...
 
 addDescriptionUsage ( $entityId, $langCode)
 Add a description usage (called once specific descriptions are accessed). More...
 
 addOtherUsage ( $entityId)
 Add a other usage. More...
 
 addSiteLinksUsage ( $entityId)
 Add a sitelink usage (called once any sitelink is accessed). More...
 
 getGlobalSiteId ()
 Get global site ID (e.g. More...
 
 getLanguageCode ()
 Get the language we are currently working with. More...
 

Private Attributes

 $plainTextTransclusionInteractor
 
 $richWikitextTransclusionInteractor
 
 $entityIdParser
 
 $language
 
 $usageAccumulator
 
 $siteId
 

Detailed Description

Actual implementations of the functions to access Wikibase through the Scribunto extension.

Author
Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::__construct ( StatementTransclusionInteractor  $plainTextTransclusionInteractor,
StatementTransclusionInteractor  $richWikitextTransclusionInteractor,
EntityIdParser  $entityIdParser,
Language  $language,
UsageAccumulator  $usageAccumulator,
  $siteId 
)
Parameters
StatementTransclusionInteractor$plainTextTransclusionInteractor
StatementTransclusionInteractor$richWikitextTransclusionInteractor
EntityIdParser$entityIdParser
Language$language
UsageAccumulator$usageAccumulator
string$siteId

Member Function Documentation

◆ addDescriptionUsage()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::addDescriptionUsage (   $entityId,
  $langCode 
)

Add a description usage (called once specific descriptions are accessed).

Parameters
string$entityIdThe Entity from which the descriptions were accessed.
string$langCodeLanguage code the descriptions accessed.

◆ addLabelUsage()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::addLabelUsage (   $entityId,
  $langCode 
)

Add a label usage (called once specific labels are accessed).

Parameters
string$entityIdThe Entity from which the labels were accessed.
string$langCodeLanguage code the labels accessed.

◆ addOtherUsage()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::addOtherUsage (   $entityId)

Add a other usage.

Parameters
string$entityIdThe Entity from which something was accessed.

◆ addSiteLinksUsage()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::addSiteLinksUsage (   $entityId)

Add a sitelink usage (called once any sitelink is accessed).

Parameters
string$entityIdThe Entity from which the sitelinks were accessed.

◆ addStatementUsage()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::addStatementUsage (   $entityId,
  $propertyId 
)

Add a statement usage (called once specific statements are accessed).

Parameters
string$entityIdThe Entity from which the statements were accessed.
string$propertyIdProperty id of the statements accessed.

◆ formatPropertyValues()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::formatPropertyValues (   $entityId,
  $propertyLabelOrId,
array  $acceptableRanks = null 
)

Format the main Snaks belonging to a Statement (which is identified by a PropertyId or the label of a Property) as wikitext escaped plain text.

Parameters
string$entityId
string$propertyLabelOrId
int[] | null$acceptableRanks
Returns
string Wikitext

◆ formatStatements()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::formatStatements (   $entityId,
  $propertyLabelOrId,
array  $acceptableRanks = null 
)

Format the main Snaks belonging to a Statement (which is identified by a PropertyId or the label of a Property) as rich wikitext.

Parameters
string$entityId
string$propertyLabelOrId
int[] | null$acceptableRanks
Returns
string Wikitext

◆ getGlobalSiteId()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::getGlobalSiteId ( )

Get global site ID (e.g.

"enwiki") This is basically a helper function.

Todo:
Make this part of mw.site in the Scribunto extension.
Returns
string

◆ getLanguageCode()

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::getLanguageCode ( )

Get the language we are currently working with.

Todo:
Once T114640 has been implemented, this should probably be generally exposed in Scribunto as parser target language.
Returns
string

Member Data Documentation

◆ $entityIdParser

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::$entityIdParser
private

◆ $language

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::$language
private

◆ $plainTextTransclusionInteractor

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::$plainTextTransclusionInteractor
private

◆ $richWikitextTransclusionInteractor

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::$richWikitextTransclusionInteractor
private

◆ $siteId

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::$siteId
private

◆ $usageAccumulator

Wikibase\Client\DataAccess\Scribunto\WikibaseLuaEntityBindings::$usageAccumulator
private

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