Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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, ContentLanguages $termsLanguages, Language $language, UsageAccumulator $usageAccumulator, $siteId)
 
 formatPropertyValues ( $entityId, $propertyLabelOrId, array $acceptableRanks=null)
 Format the main Snaks belonging to a Statement (which is identified by a NumericPropertyId or the label of a Property) as wikitext escaped plain text.
 
 formatStatements ( $entityId, $propertyLabelOrId, array $acceptableRanks=null)
 Format the main Snaks belonging to a Statement (which is identified by a NumericPropertyId or the label of a Property) as rich wikitext.
 
 addStatementUsage ( $entityId, $propertyId)
 Add a statement usage (called once specific statements are accessed).
 
 addLabelUsage ( $entityId, $langCode)
 Add a label usage (called once specific labels are accessed).
 
 addDescriptionUsage ( $entityId, $langCode)
 Add a description usage (called once specific descriptions are accessed).
 
 addOtherUsage ( $entityId)
 Add a other usage.
 
 addSiteLinksUsage ( $entityId)
 Add a sitelink usage (called once any sitelink is accessed).
 
 getGlobalSiteId ()
 Get global site ID (e.g.
 
 getLanguageCode ()
 Get the language we are currently working with.
 

Private Attributes

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

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,
ContentLanguages $termsLanguages,
Language $language,
UsageAccumulator $usageAccumulator,
$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 | null$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 | null$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 NumericPropertyId 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 NumericPropertyId 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

◆ $termsLanguages

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

◆ $usageAccumulator

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

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