Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\Sql\Terms\TermInLangIdsResolver Interface Reference

A service to turn term in lang IDs into terms, the inverse of TermInLangIdsAcquirer. More...

+ Inheritance diagram for Wikibase\Lib\Store\Sql\Terms\TermInLangIdsResolver:

Public Member Functions

 resolveTermInLangIds (array $termInLangIds, array $types=null, array $languages=null)
 Resolves terms for the given term in lang IDs.
 
 resolveGroupedTermInLangIds (array $groupedTermInLangIds, array $types=null, array $languages=null)
 Resolves terms for the given groups of term in lang IDs.
 

Detailed Description

A service to turn term in lang IDs into terms, the inverse of TermInLangIdsAcquirer.

See also
Item & Property Terms

Member Function Documentation

◆ resolveGroupedTermInLangIds()

Wikibase\Lib\Store\Sql\Terms\TermInLangIdsResolver::resolveGroupedTermInLangIds ( array $groupedTermInLangIds,
array $types = null,
array $languages = null )

Resolves terms for the given groups of term in lang IDs.

The input is an array of term in lang ID arrays, with arbitrary keys. The return value is an array of terms structures, with the same keys, where the values belong to the term in lang IDs corresponding to that key. One call to this method is effectively equivalent to multiple calls to resolveTermInLangIds with the individual term in lang ID arrays, but may be more efficient than that, e.g. resolving all the term in lang IDs in one batch and then grouping them correctly afterwards.

Parameters
int[][]$groupedTermInLangIds
null | string[]$typesIf not null, only include results of these types
null | string[]$languagesIf not null, only include results in these languages
Returns
array[]

Implemented in Wikibase\Lib\Store\Sql\Terms\DatabaseTermInLangIdsResolver, and Wikibase\Lib\Store\Sql\Terms\InMemoryTermStore.

◆ resolveTermInLangIds()

Wikibase\Lib\Store\Sql\Terms\TermInLangIdsResolver::resolveTermInLangIds ( array $termInLangIds,
array $types = null,
array $languages = null )

Resolves terms for the given term in lang IDs.

Note that the information whether the leaf nodes were single strings or arrays of strings is lost: while TermInLangIdsAcquirer::acquireTermInLangIds accepts both, this method always returns arrays of strings.

Parameters
int[]$termInLangIds
null | string[]$typesIf not null, only include results of these types
null | string[]$languagesIf not null, only include results in these languages
Returns
array containing terms per type per language. Example: [ 'label' => [ 'en' => [ 'some label' ], 'de' => [ 'another label' ], ... ], 'alias' => [ 'en' => [ 'alias', 'another alias', ...], 'de' => [ 'de alias' ], ... ], ... ]

Implemented in Wikibase\Lib\Store\Sql\Terms\DatabaseTermInLangIdsResolver, and Wikibase\Lib\Store\Sql\Terms\InMemoryTermStore.


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