Wikibase
MediaWiki Wikibase extension
|
Retrieves up page descriptions. More...
Public Member Functions | |
__construct (EntityIdLookup $idLookup, TermBuffer $termLookup, PageProps $pageProps) | |
getDescriptions (array $titles, $sources, &$actualSources=null) | |
Look up descriptions for a set of pages. | |
getDescription (Title $title, $sources, &$actualSource=null) | |
Look up description of a page. | |
Public Attributes | |
const | SOURCE_LOCAL = 'local' |
Local description, in the form of a {{SHORTDESC:...}} parser function. | |
const | SOURCE_CENTRAL = 'central' |
Central description, from a associated Wikibase repo installation. | |
const | LOCAL_PROPERTY_NAME = 'wikibase-shortdesc' |
page_props key. | |
Private Member Functions | |
getLocalDescriptions (array $titlesByPageId) | |
Look up local descriptions (stored in the page wikitext via parser function) for a set of pages. | |
getCentralDescriptions (array $titlesByPageId) | |
Look up central descriptions (stored in a linked Wikibase instance) for a set of pages. | |
Private Attributes | |
$idLookup | |
$termLookup | |
$pageProps | |
Retrieves up page descriptions.
A description is an explanation of what the page is about, in the content language of the page, short enough that it can be used in interface elements such as dropdowns to contextualize or disambiguate pages.
Wikibase\Client\Store\DescriptionLookup::__construct | ( | EntityIdLookup | $idLookup, |
TermBuffer | $termLookup, | ||
PageProps | $pageProps ) |
|
private |
Look up central descriptions (stored in a linked Wikibase instance) for a set of pages.
Title[] | $titlesByPageId | Associative array of page ID => Title object. |
Wikibase\Client\Store\DescriptionLookup::getDescription | ( | Title | $title, |
$sources, | |||
& | $actualSource = null ) |
Look up description of a page.
Convenience wrapper for getDescriptions().
Title | $title | Title to look up (will be loaded). |
array | string | $sources | One or both of the DescriptionLookup::SOURCE_* constants. When an array is provided, the second element will be used as fallback. |
string | null | &$actualSource | Will be set to one of the DescriptionLookup::SOURCE_* constants, indicating where the description came from, or null if no description was found. |
Wikibase\Client\Store\DescriptionLookup::getDescriptions | ( | array | $titles, |
$sources, | |||
& | $actualSources = null ) |
Look up descriptions for a set of pages.
Title[] | $titles | Titles to look up (will be loaded). |
array | string | $sources | One or both of the DescriptionLookup::SOURCE_* constants. When an array is provided, the second element will be used as fallback. |
array | null | &$actualSources | Will be set to an associative array of page ID => SOURCE_*, indicating where each description came from, or null if no description was found. |
|
private |
Look up local descriptions (stored in the page wikitext via parser function) for a set of pages.
Title[] | $titlesByPageId | Associative array of page ID => Title object. |
|
private |
|
private |
|
private |
const Wikibase\Client\Store\DescriptionLookup::LOCAL_PROPERTY_NAME = 'wikibase-shortdesc' |
page_props key.
const Wikibase\Client\Store\DescriptionLookup::SOURCE_CENTRAL = 'central' |
Central description, from a associated Wikibase repo installation.
const Wikibase\Client\Store\DescriptionLookup::SOURCE_LOCAL = 'local' |
Local description, in the form of a {{SHORTDESC:...}} parser function.