Wikibase
MediaWiki Wikibase extension
|
Utility class to format entity links with labels for usage in hooks. More...
Public Member Functions | |
__construct (Language $pageLanguage, EntityTitleTextLookup $entityTitleTextLookup, LanguageFactory $languageFactory) | |
getFragment (EntityId $entityId, $fragment) | |
Optionally update the fragment of the link. | |
Public Member Functions inherited from Wikibase\Repo\Hooks\Formatters\EntityLinkFormatter | |
getHtml (EntityId $entityId, ?array $labelData=null) | |
Produce link HTML from Entity ID and label data. | |
getTitleAttribute (EntityId $entityId, ?array $labelData=null, ?array $descriptionData=null) | |
Get "title" attribute for Wikidata entity link. | |
Private Member Functions | |
extractTextAndLanguage (?array $termData) | |
Private Attributes | |
$pageLanguage | |
$entityTitleTextLookup | |
$languageFactory | |
Utility class to format entity links with labels for usage in hooks.
Wikibase\Repo\Hooks\Formatters\DefaultEntityLinkFormatter::__construct | ( | Language | $pageLanguage, |
EntityTitleTextLookup | $entityTitleTextLookup, | ||
LanguageFactory | $languageFactory ) |
|
private |
string[] | null | $termData | A term record as returned by TermLanguageFallbackChain::extractPreferredValueOrAny(), containing the 'value' and 'language' fields, or null or an empty array. |
Wikibase\Repo\Hooks\Formatters\DefaultEntityLinkFormatter::getFragment | ( | EntityId | $entityId, |
$fragment ) |
Optionally update the fragment of the link.
This is necessary for subentities, where the link points to a section of the parent entity’s page; if the anchor of that section changes (e.g. from including the parent entity ID to not including it), we want to update the fragment in old links to that entity accordingly. See T208423 for an example of this.
EntityId | $entityId | |
string | $fragment | The current fragment of the link, not including an initial '#'. |
Implements Wikibase\Repo\Hooks\Formatters\EntityLinkFormatter.
|
private |
|
private |
|
private |