Wikibase
MediaWiki Wikibase extension
|
TermIndex implementation that does nothing. More...
Public Member Functions | |||||||||||||
saveTermsOfEntity (EntityDocument $entity) | |||||||||||||
Saves the terms of the provided entity in the term cache.
| |||||||||||||
deleteTermsOfEntity (EntityId $entityId) | |||||||||||||
Deletes the terms of the provided entity from the term cache.
| |||||||||||||
getTermsOfEntity (EntityId $entityId, array $termTypes=null, array $languageCodes=null) | |||||||||||||
Returns the terms stored for the given entity.
| |||||||||||||
getTermsOfEntities (array $entityIds, array $termTypes=null, array $languageCodes=null) | |||||||||||||
Returns the terms stored for the given entities.Can be filtered by language. Note that all entities queried in one call must be of the same type.
| |||||||||||||
getMatchingTerms (array $criteria, $termType=null, $entityType=null, array $options=[]) | |||||||||||||
Returns the terms that match the provided conditions.$terms is an array of Term objects. Terms are joined by OR. The fields of the terms are joined by AND.A default can be provided for termType and entityType via the corresponding method parameters.
| |||||||||||||
getTopMatchingTerms (array $criteria, $termType=null, $entityType=null, array $options=[]) | |||||||||||||
Returns the terms that match the provided conditions ranked with the 'most important' / top first.Will only return one TermIndexEntry per Entity$terms is an array of Term objects. Terms are joined by OR. The fields of the terms are joined by AND.A default can be provided for termType and entityType via the corresponding method parameters.
| |||||||||||||
clear () | |||||||||||||
Clears all terms from the cache.This is used both with the EntityTermStoreWriter methods and LegacyEntityTermStoreReader. Hence why it lives in this middle ground.
| |||||||||||||
TermIndex implementation that does nothing.
This will for example be used in the MediaInfo entity handler which currently gets a real TermIndex implementation despite not needing to use it at all.
Wikibase\Lib\Store\NullTermIndex::clear | ( | ) |
Clears all terms from the cache.This is used both with the EntityTermStoreWriter methods and LegacyEntityTermStoreReader. Hence why it lives in this middle ground.
Implements Wikibase\Lib\Store\TermIndex.
Wikibase\Lib\Store\NullTermIndex::deleteTermsOfEntity | ( | EntityId | $entityId | ) |
Deletes the terms of the provided entity from the term cache.
EntityId | $entityId |
Implements Wikibase\Lib\Store\EntityTermStoreWriter.
Wikibase\Lib\Store\NullTermIndex::getMatchingTerms | ( | array | $criteria, |
$termType = null , |
|||
$entityType = null , |
|||
array | $options = [] |
||
) |
Returns the terms that match the provided conditions.$terms is an array of Term objects. Terms are joined by OR. The fields of the terms are joined by AND.A default can be provided for termType and entityType via the corresponding method parameters.
TermIndexSearchCriteria[] | $criteria | |
string | string[] | null | $termType | |
string | string[] | null | $entityType | |
array | $options | Accepted options are:
|
Implements Wikibase\Lib\Store\MatchingTermsLookup.
Wikibase\Lib\Store\NullTermIndex::getTermsOfEntities | ( | array | $entityIds, |
array | $termTypes = null , |
||
array | $languageCodes = null |
||
) |
Returns the terms stored for the given entities.Can be filtered by language. Note that all entities queried in one call must be of the same type.
EntityId[] | $entityIds | Entity ids of one type only. |
string[] | null | $termTypes | The types of terms to return, e.g. "label", "description", or "alias". Compare the TermIndexEntry::TYPE_XXX constants. If null, all types are returned. |
string[] | null | $languageCodes | The desired languages, given as language codes. If null, all languages are returned. |
Implements Wikibase\Lib\Store\LegacyEntityTermStoreReader.
Wikibase\Lib\Store\NullTermIndex::getTermsOfEntity | ( | EntityId | $entityId, |
array | $termTypes = null , |
||
array | $languageCodes = null |
||
) |
Returns the terms stored for the given entity.
EntityId | $entityId | |
string[] | null | $termTypes | The types of terms to return, e.g. "label", "description", or "alias". Compare the TermIndexEntry::TYPE_XXX constants. If null, all types are returned. |
string[] | null | $languageCodes | The desired languages, given as language codes. If null, all languages are returned. |
Implements Wikibase\Lib\Store\LegacyEntityTermStoreReader.
Wikibase\Lib\Store\NullTermIndex::getTopMatchingTerms | ( | array | $criteria, |
$termType = null , |
|||
$entityType = null , |
|||
array | $options = [] |
||
) |
Returns the terms that match the provided conditions ranked with the 'most important' / top first.Will only return one TermIndexEntry per Entity$terms is an array of Term objects. Terms are joined by OR. The fields of the terms are joined by AND.A default can be provided for termType and entityType via the corresponding method parameters.
TermIndexSearchCriteria[] | $criteria | |
string | string[] | null | $termType | |
string | string[] | null | $entityType | |
array | $options | Accepted options are:
|
Implements Wikibase\Lib\Store\MatchingTermsLookup.
Wikibase\Lib\Store\NullTermIndex::saveTermsOfEntity | ( | EntityDocument | $entity | ) |
Saves the terms of the provided entity in the term cache.
EntityDocument | $entity | Must have an ID, and optionally any combination of terms as declared by the TermIndexEntry::TYPE_... constants. |
InvalidArgumentException | when $entity does not have an ID. |
Implements Wikibase\Lib\Store\EntityTermStoreWriter.