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

Actual implementations of various functions to access Wikibase functionality through Scribunto. More...

Public Member Functions

 __construct (SiteLinkLookup $siteLinkLookup, EntityIdLookup $entityIdLookup, SettingsArray $settings, UsageAccumulator $usageAccumulator, EntityIdParser $entityIdParser, TermLookup $termLookup, ContentLanguages $termsLanguages, ReferencedEntityIdLookup $referencedEntityIdLookup, TitleFormatter $titleFormatter, TitleParser $titleParser, string $siteId, RevisionBasedEntityRedirectTargetLookup $redirectTargetLookup)
 
 getEntityId ( $pageTitle, $globalSiteId)
 Get entity ID from page title and optionally global site ID. More...
 
 isValidEntityId ( $entityIdSerialization)
 Is this a valid (parseable) entity id. More...
 
 getLabelByLanguage ( $prefixedEntityId, $languageCode)
 
 getSetting ( $setting)
 
 getSiteLinkPageName ( $prefixedItemId, $globalSiteId)
 
 getReferencedEntityId (EntityId $fromId, PropertyId $propertyId, array $toIds)
 

Private Member Functions

 normalizePageTitle ( $pageTitle)
 
 trackUsageForTitleOrSitelink (string $globalSiteId, EntityId $entityId)
 

Private Attributes

 $siteLinkLookup
 
 $entityIdLookup
 
 $settings
 
 $usageAccumulator
 
 $entityIdParser
 
 $termLookup
 
 $termsLanguages
 
 $referencedEntityIdLookup
 
 $titleFormatter
 
 $titleParser
 
 $siteId
 
 $redirectTargetLookup
 

Detailed Description

Actual implementations of various functions to access Wikibase functionality through Scribunto.

All functions in here are independent from the target language, meaning that this class can be instantiated without knowing the target language.

Author
Jens Ohlig < jens..nosp@m.ohli.nosp@m.g@wik.nosp@m.imed.nosp@m.ia.de >
Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::__construct ( SiteLinkLookup  $siteLinkLookup,
EntityIdLookup  $entityIdLookup,
SettingsArray  $settings,
UsageAccumulator  $usageAccumulator,
EntityIdParser  $entityIdParser,
TermLookup  $termLookup,
ContentLanguages  $termsLanguages,
ReferencedEntityIdLookup  $referencedEntityIdLookup,
TitleFormatter  $titleFormatter,
TitleParser  $titleParser,
string  $siteId,
RevisionBasedEntityRedirectTargetLookup  $redirectTargetLookup 
)

Member Function Documentation

◆ getEntityId()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::getEntityId (   $pageTitle,
  $globalSiteId 
)

Get entity ID from page title and optionally global site ID.

Parameters
string$pageTitle
string | null$globalSiteId
Returns
string|null

◆ getLabelByLanguage()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::getLabelByLanguage (   $prefixedEntityId,
  $languageCode 
)
Parameters
string$prefixedEntityId
string$languageCode
Returns
string|null Null if language code invalid or entity couldn't be found/ no label present.

◆ getReferencedEntityId()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::getReferencedEntityId ( EntityId  $fromId,
PropertyId  $propertyId,
array  $toIds 
)
Parameters
EntityId$fromId
PropertyId$propertyId
EntityId[]$toIds
Returns
string|null|bool Serialization of the referenced entity id, if one could be found. Null if none of the given entities is referenced. False if the search for a referenced entity had to be aborted due to resource limits.

◆ getSetting()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::getSetting (   $setting)
Parameters
string$setting
Returns
mixed

◆ getSiteLinkPageName()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::getSiteLinkPageName (   $prefixedItemId,
  $globalSiteId 
)
Parameters
string$prefixedItemId
string | null$globalSiteId
Returns
string|null Null if no site link found.

◆ isValidEntityId()

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

Is this a valid (parseable) entity id.

Parameters
string$entityIdSerialization
Returns
bool

◆ normalizePageTitle()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::normalizePageTitle (   $pageTitle)
private
Parameters
string$pageTitle
Returns
string

◆ trackUsageForTitleOrSitelink()

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::trackUsageForTitleOrSitelink ( string  $globalSiteId,
EntityId  $entityId 
)
private

Member Data Documentation

◆ $entityIdLookup

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$entityIdLookup
private

◆ $entityIdParser

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

◆ $redirectTargetLookup

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$redirectTargetLookup
private

◆ $referencedEntityIdLookup

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$referencedEntityIdLookup
private

◆ $settings

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$settings
private

◆ $siteId

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

◆ $siteLinkLookup

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$siteLinkLookup
private

◆ $termLookup

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$termLookup
private

◆ $termsLanguages

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

◆ $titleFormatter

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$titleFormatter
private

◆ $titleParser

Wikibase\Client\DataAccess\Scribunto\WikibaseLanguageIndependentLuaBindings::$titleParser
private

◆ $usageAccumulator

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

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