Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer Class Reference

Handler of the {{#property}} parser function. More...

+ Inheritance diagram for Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer:
+ Collaboration diagram for Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer:

Public Member Functions

 __construct (array $languageAwareRenderers, array $variants)
 
 render (EntityId $entityId, $propertyLabelOrId)
 

Private Member Functions

 buildRenderedVariantsArray (EntityId $entityId, $propertyLabelOrId)
 
 processRenderedArray (array $textArray)
 Post-process rendered array (variant text) into wikitext to be used in pages.
 
 getVariantText ( $variantCode, EntityId $entityId, $propertyLabelOrId)
 
 getLanguageAwareRendererFromCode ( $variantCode)
 

Private Attributes

 $variants
 
 $languageAwareRenderers
 

Detailed Description

Handler of the {{#property}} parser function.

Author
Katie Filbert < aude..nosp@m.wiki.nosp@m.@gmai.nosp@m.l.co.nosp@m.m >
Thiemo Kreuz

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::__construct ( array $languageAwareRenderers,
array $variants )
Parameters
LanguageAwareRenderer[]$languageAwareRenderers
string[]$variants

Member Function Documentation

◆ buildRenderedVariantsArray()

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::buildRenderedVariantsArray ( EntityId $entityId,
$propertyLabelOrId )
private
Parameters
EntityId$entityId
string$propertyLabelOrId
Exceptions
OutOfBoundsException
Returns
string[] key by variant codes

◆ getLanguageAwareRendererFromCode()

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::getLanguageAwareRendererFromCode ( $variantCode)
private
Parameters
string$variantCode
Exceptions
OutOfBoundsException
Returns
LanguageAwareRenderer

◆ getVariantText()

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::getVariantText ( $variantCode,
EntityId $entityId,
$propertyLabelOrId )
private
Parameters
string$variantCode
EntityId$entityId
string$propertyLabelOrId
Exceptions
OutOfBoundsException
Returns
string Wikitext

◆ processRenderedArray()

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::processRenderedArray ( array $textArray)
private

Post-process rendered array (variant text) into wikitext to be used in pages.

Parameters
string[]$textArray
Returns
string Wikitext

◆ render()

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::render ( EntityId $entityId,
$propertyLabelOrId )
Parameters
EntityId$entityId
string$propertyLabelOrId
Exceptions
OutOfBoundsException
Returns
string Wikitext

Implements Wikibase\Client\DataAccess\ParserFunctions\StatementGroupRenderer.

Member Data Documentation

◆ $languageAwareRenderers

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::$languageAwareRenderers
private

◆ $variants

Wikibase\Client\DataAccess\ParserFunctions\VariantsAwareRenderer::$variants
private

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