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 ( $prefixedEntityId)
 Wrapper for getEntity in EntityAccessor. More...
 
 getReferencedEntityId ( $prefixedFromEntityId, $prefixedPropertyId, $prefixedToIds)
 Wrapper for getReferencedEntityId in WikibaseLanguageIndependentLuaBindings. More...
 
 entityExists ( $prefixedEntityId)
 Wrapper for entityExists in EntityAccessor. More...
 
 getEntityStatements ( $prefixedEntityId, $propertyId, $rank)
 Wrapper for getEntityStatements in EntityAccessor. More...
 
 getEntityId ( $pageTitle, $globalSiteId=null)
 Wrapper for getEntityId in WikibaseLanguageIndependentLuaBindings. More...
 
 getEntityUrl ( $entityIdSerialization)
 
 setRepoLinker (RepoLinker $repoLinker)
 
 getLabel ( $prefixedEntityId)
 Wrapper for getLabel in WikibaseLanguageDependentLuaBindings. More...
 
 getLabelByLanguage ( $prefixedEntityId, $languageCode)
 Wrapper for getLabelByLanguage in WikibaseLanguageIndependentLuaBindings. More...
 
 getDescription ( $prefixedEntityId)
 Wrapper for getDescription in WikibaseLanguageDependentLuaBindings. More...
 
 getSiteLinkPageName ( $prefixedItemId, $globalSiteId)
 Wrapper for getSiteLinkPageName in WikibaseLanguageIndependentLuaBindings. More...
 
 isValidEntityId ( $entityIdSerialization)
 Wrapper for WikibaseLanguageIndependentLuaBindings::isValidEntityId. More...
 
 renderSnak ( $snakSerialization)
 Wrapper for SnakSerializationRenderer::renderSnak, set to output wikitext escaped plain text. More...
 
 formatValue ( $snakSerialization)
 Wrapper for SnakSerializationRenderer::renderSnak, set to output rich wikitext. More...
 
 renderSnaks ( $snaksSerialization)
 Wrapper for SnakSerializationRenderer::renderSnaks, set to output wikitext escaped plain text. More...
 
 formatValues ( $snaksSerialization)
 Wrapper for SnakSerializationRenderer::renderSnaks, set to output rich wikitext. More...
 
 resolvePropertyId ( $propertyLabelOrId)
 Wrapper for PropertyIdResolver. More...
 
 orderProperties (array $propertyIds)
 
 getPropertyOrder ()
 Return the order of properties as provided by the PropertyOrderProvider. More...
 
 incrementStatsKey ( $key)
 Increment the given stats key. More...
 
 getEntityModuleName ( $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 ( $type)
 
 getLanguageFallbackChain ()
 
 getPropertyIdResolver ()
 
 getLanguage ()
 Returns the language to use. More...
 
 getLuaFunctionCallTracker ()
 
 allowDataAccessInUserLanguage ()
 
 newEntityAccessor ()
 
 newSnakSerializationRenderer ( $type)
 
 newLanguageDependentLuaBindings ()
 
 newLanguageIndependentLuaBindings ()
 
 getEntityIdParser ()
 
 parseUserGivenEntityId ( $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
Returns
bool

◆ entityExists()

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

Wrapper for entityExists in EntityAccessor.

Parameters
string$prefixedEntityId
Exceptions
ScribuntoException
Returns
bool[]

◆ formatValue()

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

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

Parameters
array$snakSerialization
Exceptions
ScribuntoException
Returns
string[] Wikitext

◆ formatValues()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::formatValues (   $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 (   $prefixedEntityId)

Wrapper for getDescription in WikibaseLanguageDependentLuaBindings.

Parameters
string$prefixedEntityId
Returns
string[]|null[]

◆ getEntity()

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

Wrapper for getEntity in EntityAccessor.

Parameters
string$prefixedEntityId
Exceptions
ScribuntoException
Returns
array

◆ getEntityAccessor()

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

◆ getEntityId()

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

Wrapper for getEntityId in WikibaseLanguageIndependentLuaBindings.

Parameters
string$pageTitle
string | null$globalSiteId
Returns
array

◆ getEntityIdParser()

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

◆ getEntityModuleName()

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

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

Parameters
string$prefixedEntityId
Returns
string[]

◆ getEntityStatements()

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

Wrapper for getEntityStatements in EntityAccessor.

Parameters
string$prefixedEntityId
string$propertyId
string$rankWhich statements to include. Either "best" or "all".
Exceptions
ScribuntoException
Returns
array

◆ getEntityUrl()

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

◆ getLabel()

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

Wrapper for getLabel in WikibaseLanguageDependentLuaBindings.

Parameters
string$prefixedEntityId
Returns
string[]|null[]

◆ getLabelByLanguage()

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

Wrapper for getLabelByLanguage in WikibaseLanguageIndependentLuaBindings.

Parameters
string$prefixedEntityId
string$languageCode
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.

Returns
Language

◆ 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
Returns
PropertyOrderProvider

◆ getReferencedEntityId()

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

Wrapper for getReferencedEntityId in WikibaseLanguageIndependentLuaBindings.

Parameters
string$prefixedFromEntityId
string$prefixedPropertyId
string[]$prefixedToIds
Exceptions
ScribuntoException
Returns
array

◆ getRepoLinker()

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

◆ getSiteLinkPageName()

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

Wrapper for getSiteLinkPageName in WikibaseLanguageIndependentLuaBindings.

Parameters
string$prefixedItemId
string | null$globalSiteId
Returns
string[]

◆ getSnakSerializationRenderer()

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

◆ getUsageAccumulator()

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

◆ incrementStatsKey()

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

Increment the given stats key.

Parameters
string$key

◆ isValidEntityId()

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

Wrapper for WikibaseLanguageIndependentLuaBindings::isValidEntityId.

Parameters
string$entityIdSerialization
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 (   $type)
private
Parameters
string$typeOne of DataAccessSnakFormatterFactory::TYPE_*
Returns
SnakSerializationRenderer

◆ orderProperties()

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

◆ parseUserGivenEntityId()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::parseUserGivenEntityId (   $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 (   $snakSerialization)

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

Parameters
array$snakSerialization
Exceptions
ScribuntoException
Returns
string[] Wikitext

◆ renderSnaks()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::renderSnaks (   $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 (   $propertyLabelOrId)

Wrapper for PropertyIdResolver.

Parameters
string$propertyLabelOrId
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: