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

Registers and defines functions to access Wikibase through the Scribunto extension. More...

+ Inheritance diagram for Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary:
+ Collaboration diagram for Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary:

Public Member Functions

 getUsageAccumulator ()
 
 register ()
 Register mw.wikibase.lua library. More...
 
 getEntity (string $prefixedEntityId)
 Wrapper for getEntity in EntityAccessor. More...
 
 getReferencedEntityId (string $prefixedFromEntityId, string $prefixedPropertyId, array $prefixedToIds)
 Wrapper for getReferencedEntityId in WikibaseLanguageIndependentLuaBindings. More...
 
 entityExists (string $prefixedEntityId)
 Wrapper for entityExists in EntityAccessor. More...
 
 getEntityStatements (string $prefixedEntityId, string $propertyId, string $rank)
 Wrapper for getEntityStatements in EntityAccessor. More...
 
 getEntityId (string $pageTitle, string $globalSiteId=null)
 Wrapper for getEntityId in WikibaseLanguageIndependentLuaBindings. More...
 
 getEntityUrl (string $entityIdSerialization)
 
 setRepoLinker (RepoLinker $repoLinker)
 
 getLabel (string $prefixedEntityId)
 Wrapper for getLabel in WikibaseLanguageDependentLuaBindings. More...
 
 getLabelByLanguage (string $prefixedEntityId, string $languageCode)
 Wrapper for getLabelByLanguage in WikibaseLanguageIndependentLuaBindings. More...
 
 getDescription (string $prefixedEntityId)
 Wrapper for getDescription in WikibaseLanguageDependentLuaBindings. More...
 
 getSiteLinkPageName (string $prefixedItemId, ?string $globalSiteId)
 Wrapper for getSiteLinkPageName in WikibaseLanguageIndependentLuaBindings. More...
 
 isValidEntityId (string $entityIdSerialization)
 Wrapper for WikibaseLanguageIndependentLuaBindings::isValidEntityId. More...
 
 renderSnak (array $snakSerialization)
 Wrapper for SnakSerializationRenderer::renderSnak, set to output wikitext escaped plain text. More...
 
 formatValue (array $snakSerialization)
 Wrapper for SnakSerializationRenderer::renderSnak, set to output rich wikitext. More...
 
 renderSnaks (array $snaksSerialization)
 Wrapper for SnakSerializationRenderer::renderSnaks, set to output wikitext escaped plain text. More...
 
 formatValues (array $snaksSerialization)
 Wrapper for SnakSerializationRenderer::renderSnaks, set to output rich wikitext. More...
 
 resolvePropertyId (string $propertyLabelOrId)
 Wrapper for PropertyIdResolver. More...
 
 orderProperties (array $propertyIds)
 
 getPropertyOrder ()
 Return the order of properties as provided by the PropertyOrderProvider. More...
 
 incrementStatsKey (string $key)
 Increment the given stats key. More...
 
 getEntityModuleName (string $prefixedEntityId)
 Get the entity module name to use for the entity with this ID. More...
 
 setPropertyOrderProvider (PropertyOrderProvider $propertyOrderProvider)
 

Private Member Functions

 getLanguageIndependentLuaBindings ()
 
 getLanguageDependentLuaBindings ()
 
 getEntityAccessor ()
 
 getSnakSerializationRenderer (string $type)
 
 getLanguageFallbackChain ()
 
 getPropertyIdResolver ()
 
 getLanguage ()
 Returns the language to use. More...
 
 getLuaFunctionCallTracker ()
 
 allowDataAccessInUserLanguage ()
 
 newEntityAccessor ()
 
 newSnakSerializationRenderer (string $type)
 
 newLanguageDependentLuaBindings ()
 
 newLanguageIndependentLuaBindings ()
 
 getEntityIdParser ()
 
 parseUserGivenEntityId (string $idSerialization)
 
 getRepoLinker ()
 
 getPropertyOrderProvider ()
 
 getLuaEntityModules ()
 

Private Attributes

 $languageIndependentLuaBindings = null
 
 $languageDependentLuaBindings = null
 
 $entityAccessor = null
 
 $snakSerializationRenderers = []
 
 $termFallbackChain = null
 
 $usageAccumulator = null
 
 $propertyIdResolver = null
 
 $propertyOrderProvider = null
 
 $entityIdParser = null
 
 $repoLinker = null
 
 $luaFunctionCallTracker = null
 
 $luaEntityModules = null
 

Detailed Description

Registers and defines functions to access Wikibase through the Scribunto extension.

Member Function Documentation

◆ allowDataAccessInUserLanguage()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::allowDataAccessInUserLanguage ( )
private

◆ entityExists()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::entityExists ( string  $prefixedEntityId)

Wrapper for entityExists in EntityAccessor.

Exceptions
ScribuntoException
Returns
bool[]

◆ formatValue()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::formatValue ( array  $snakSerialization)

Wrapper for SnakSerializationRenderer::renderSnak, set to output rich wikitext.

Exceptions
ScribuntoException
Returns
string[] Wikitext

◆ formatValues()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::formatValues ( array  $snaksSerialization)

Wrapper for SnakSerializationRenderer::renderSnaks, set to output rich wikitext.

Parameters
array[]$snaksSerialization
Exceptions
ScribuntoException
Returns
string[] Wikitext

◆ getDescription()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getDescription ( string  $prefixedEntityId)

Wrapper for getDescription in WikibaseLanguageDependentLuaBindings.

Returns
string[]|null[]

◆ getEntity()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getEntity ( string  $prefixedEntityId)

Wrapper for getEntity in EntityAccessor.

Exceptions
ScribuntoException

◆ getEntityAccessor()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getEntityAccessor ( )
private

◆ getEntityId()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getEntityId ( string  $pageTitle,
string  $globalSiteId = null 
)

Wrapper for getEntityId in WikibaseLanguageIndependentLuaBindings.

◆ getEntityIdParser()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getEntityIdParser ( )
private

◆ getEntityModuleName()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getEntityModuleName ( string  $prefixedEntityId)

Get the entity module name to use for the entity with this ID.

Returns
string[]

◆ getEntityStatements()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getEntityStatements ( string  $prefixedEntityId,
string  $propertyId,
string  $rank 
)

Wrapper for getEntityStatements in EntityAccessor.

Parameters
string$rankWhich statements to include. Either "best" or "all".
Exceptions
ScribuntoException

◆ getEntityUrl()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getEntityUrl ( string  $entityIdSerialization)
Parameters
string$entityIdSerializationentity ID serialization
Returns
string[]|null[]

◆ getLabel()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLabel ( string  $prefixedEntityId)

Wrapper for getLabel in WikibaseLanguageDependentLuaBindings.

Returns
string[]|null[]

◆ getLabelByLanguage()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLabelByLanguage ( string  $prefixedEntityId,
string  $languageCode 
)

Wrapper for getLabelByLanguage in WikibaseLanguageIndependentLuaBindings.

Returns
string[]|null[]

◆ getLanguage()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLanguage ( )
private

Returns the language to use.

If we are on a multilingual wiki (allowDataAccessInUserLanguage is true) this will be the user's interface language, otherwise it will be the content language. In a perfect world, this would equal Parser::getTargetLanguage.

This can probably be removed after T114640 has been implemented.

Please note, that this splits the parser cache by user language, if allowDataAccessInUserLanguage is true.

◆ getLanguageDependentLuaBindings()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLanguageDependentLuaBindings ( )
private

◆ getLanguageFallbackChain()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLanguageFallbackChain ( )
private

◆ getLanguageIndependentLuaBindings()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLanguageIndependentLuaBindings ( )
private

◆ getLuaEntityModules()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLuaEntityModules ( )
private

◆ getLuaFunctionCallTracker()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getLuaFunctionCallTracker ( )
private

◆ getPropertyIdResolver()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getPropertyIdResolver ( )
private

◆ getPropertyOrder()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getPropertyOrder ( )

Return the order of properties as provided by the PropertyOrderProvider.

Returns
array[] either int[][] or null[][]

◆ getPropertyOrderProvider()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getPropertyOrderProvider ( )
private

◆ getReferencedEntityId()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getReferencedEntityId ( string  $prefixedFromEntityId,
string  $prefixedPropertyId,
array  $prefixedToIds 
)

Wrapper for getReferencedEntityId in WikibaseLanguageIndependentLuaBindings.

Parameters
string[]$prefixedToIds
Exceptions
ScribuntoException

◆ getRepoLinker()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getRepoLinker ( )
private

◆ getSiteLinkPageName()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getSiteLinkPageName ( string  $prefixedItemId,
?string  $globalSiteId 
)

Wrapper for getSiteLinkPageName in WikibaseLanguageIndependentLuaBindings.

Returns
string[]

◆ getSnakSerializationRenderer()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getSnakSerializationRenderer ( string  $type)
private
Parameters
string$typeOne of DataAccessSnakFormatterFactory::TYPE_*

◆ getUsageAccumulator()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getUsageAccumulator ( )

◆ incrementStatsKey()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::incrementStatsKey ( string  $key)

Increment the given stats key.

◆ isValidEntityId()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::isValidEntityId ( string  $entityIdSerialization)

Wrapper for WikibaseLanguageIndependentLuaBindings::isValidEntityId.

Exceptions
ScribuntoException
Returns
bool[] One bool telling whether the entity id is valid (parseable).

◆ newEntityAccessor()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::newEntityAccessor ( )
private

◆ newLanguageDependentLuaBindings()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::newLanguageDependentLuaBindings ( )
private

◆ newLanguageIndependentLuaBindings()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::newLanguageIndependentLuaBindings ( )
private

◆ newSnakSerializationRenderer()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::newSnakSerializationRenderer ( string  $type)
private
Parameters
string$typeOne of DataAccessSnakFormatterFactory::TYPE_*

◆ orderProperties()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::orderProperties ( array  $propertyIds)
Parameters
string[]$propertyIds
Returns
array[]

◆ parseUserGivenEntityId()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::parseUserGivenEntityId ( string  $idSerialization)
private
Exceptions

◆ register()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::register ( )

Register mw.wikibase.lua library.

Returns
array

◆ renderSnak()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::renderSnak ( array  $snakSerialization)

Wrapper for SnakSerializationRenderer::renderSnak, set to output wikitext escaped plain text.

Exceptions
ScribuntoException
Returns
string[] Wikitext

◆ renderSnaks()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::renderSnaks ( array  $snaksSerialization)

Wrapper for SnakSerializationRenderer::renderSnaks, set to output wikitext escaped plain text.

Parameters
array[]$snaksSerialization
Exceptions
ScribuntoException
Returns
string[] Wikitext

◆ resolvePropertyId()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::resolvePropertyId ( string  $propertyLabelOrId)

Wrapper for PropertyIdResolver.

Returns
string[]|null[]

◆ setPropertyOrderProvider()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::setPropertyOrderProvider ( PropertyOrderProvider  $propertyOrderProvider)

◆ setRepoLinker()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::setRepoLinker ( RepoLinker  $repoLinker)

Member Data Documentation

◆ $entityAccessor

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$entityAccessor = null
private

◆ $entityIdParser

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$entityIdParser = null
private

◆ $languageDependentLuaBindings

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$languageDependentLuaBindings = null
private

◆ $languageIndependentLuaBindings

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$languageIndependentLuaBindings = null
private

◆ $luaEntityModules

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$luaEntityModules = null
private

◆ $luaFunctionCallTracker

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$luaFunctionCallTracker = null
private

◆ $propertyIdResolver

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$propertyIdResolver = null
private

◆ $propertyOrderProvider

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$propertyOrderProvider = null
private

◆ $repoLinker

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$repoLinker = null
private

◆ $snakSerializationRenderers

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$snakSerializationRenderers = []
private

◆ $termFallbackChain

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$termFallbackChain = null
private

◆ $usageAccumulator

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$usageAccumulator = null
private

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