Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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.
 
 getEntity ( $prefixedEntityId)
 Wrapper for getEntity in EntityAccessor.
 
 getReferencedEntityId ( $prefixedFromEntityId, $prefixedPropertyId, $prefixedToIds)
 Wrapper for getReferencedEntityId in WikibaseLanguageIndependentLuaBindings.
 
 entityExists ( $prefixedEntityId)
 Wrapper for entityExists in EntityAccessor.
 
 getEntityStatements ( $prefixedEntityId, $propertyId, $rank)
 Wrapper for getEntityStatements in EntityAccessor.
 
 getEntityId ( $pageTitle, $globalSiteId=null)
 Wrapper for getEntityId in WikibaseLanguageIndependentLuaBindings.
 
 getSetting ( $setting)
 Wrapper for getSetting in WikibaseLanguageIndependentLuaBindings.
 
 getEntityUrl ( $entityIdSerialization)
 
 setRepoLinker (RepoLinker $repoLinker)
 
 getLabel ( $prefixedEntityId)
 Wrapper for getLabel in WikibaseLanguageDependentLuaBindings.
 
 getLabelByLanguage ( $prefixedEntityId, $languageCode)
 Wrapper for getLabelByLanguage in WikibaseLanguageIndependentLuaBindings.
 
 getDescription ( $prefixedEntityId)
 Wrapper for getDescription in WikibaseLanguageDependentLuaBindings.
 
 getSiteLinkPageName ( $prefixedItemId, $globalSiteId)
 Wrapper for getSiteLinkPageName in WikibaseLanguageIndependentLuaBindings.
 
 isValidEntityId ( $entityIdSerialization)
 Wrapper for WikibaseLanguageIndependentLuaBindings::isValidEntityId.
 
 renderSnak ( $snakSerialization)
 Wrapper for SnakSerializationRenderer::renderSnak, set to output wikitext escaped plain text.
 
 formatValue ( $snakSerialization)
 Wrapper for SnakSerializationRenderer::renderSnak, set to output rich wikitext.
 
 renderSnaks ( $snaksSerialization)
 Wrapper for SnakSerializationRenderer::renderSnaks, set to output wikitext escaped plain text.
 
 formatValues ( $snaksSerialization)
 Wrapper for SnakSerializationRenderer::renderSnaks, set to output rich wikitext.
 
 resolvePropertyId ( $propertyLabelOrId)
 Wrapper for PropertyIdResolver.
 
 orderProperties (array $propertyIds)
 
 getPropertyOrder ()
 Return the order of properties as provided by the PropertyOrderProvider.
 
 incrementStatsKey ( $key)
 Increment the given stats key.
 
 getEntityModuleName ( $prefixedEntityId)
 Get the entity module name to use for the entity with this ID.
 
 setPropertyOrderProvider (PropertyOrderProvider $propertyOrderProvider)
 

Private Member Functions

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

Private Attributes

 $languageIndependentLuaBindings = null
 
 $languageDependentLuaBindings = null
 
 $entityAccessor = null
 
 $snakSerializationRenderers = []
 
 $fallbackChain = 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
Returns
EntityAccessor

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

◆ getLanguageFallbackChain()

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

◆ getLanguageIndependentLuaBindings()

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

◆ getLuaEntityModules()

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

◆ getLuaFunctionCallTracker()

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

◆ getPropertyIdResolver()

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

◆ 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

◆ getSetting()

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::getSetting (   $setting)

Wrapper for getSetting in WikibaseLanguageIndependentLuaBindings.

Parameters
string$setting
Returns
array

◆ 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

ScribuntoException

Returns
EntityId

◆ 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

◆ $fallbackChain

Wikibase\Client\DataAccess\Scribunto\Scribunto_LuaWikibaseLibrary::$fallbackChain = 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

◆ $usageAccumulator

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

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