Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Formatters\VocabularyUriFormatter Class Reference

A dedicated formatter for concept URIs referring to entities on a vocabulary repository. More...

+ Inheritance diagram for Wikibase\Lib\Formatters\VocabularyUriFormatter:
+ Collaboration diagram for Wikibase\Lib\Formatters\VocabularyUriFormatter:

Public Member Functions

 __construct (EntityIdParser $vocabUriParser, LabelDescriptionLookup $labelLookup, array $unitlessUnitIds=[])
 
 format ( $conceptUri)
 

Private Attributes

 $vocabUriParser
 
 $labelLookup
 
 $unitlessUnitIds
 

Detailed Description

A dedicated formatter for concept URIs referring to entities on a vocabulary repository.

Author
Thiemo Kreuz

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Formatters\VocabularyUriFormatter::__construct ( EntityIdParser $vocabUriParser,
LabelDescriptionLookup $labelLookup,
array $unitlessUnitIds = [] )
Parameters
EntityIdParser$vocabUriParser
LabelDescriptionLookup$labelLookup
string[]$unitlessUnitIdsA list of IDs that represent the "unitless" unit (one), e.g. "http://www.wikidata.org/entity/Q199". The strings "" and "1" are always treated as "non-units".

Member Function Documentation

◆ format()

Wikibase\Lib\Formatters\VocabularyUriFormatter::format ( $conceptUri)
See also
ValueFormatter::format
Parameters
string$conceptUri
Exceptions
InvalidArgumentException
Returns
string|null Null if the concept URI refers to a unitless unit. Otherwise a label or an entity ID or the original concept URI.

Member Data Documentation

◆ $labelLookup

Wikibase\Lib\Formatters\VocabularyUriFormatter::$labelLookup
private

◆ $unitlessUnitIds

Wikibase\Lib\Formatters\VocabularyUriFormatter::$unitlessUnitIds
private

◆ $vocabUriParser

Wikibase\Lib\Formatters\VocabularyUriFormatter::$vocabUriParser
private

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