Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\NullTermIndex Class Reference

TermIndex implementation that does nothing. More...

+ Inheritance diagram for Wikibase\Lib\Store\NullTermIndex:
+ Collaboration diagram for Wikibase\Lib\Store\NullTermIndex:

Public Member Functions

 saveTermsOfEntity (EntityDocument $entity)
 Saves the terms of the provided entity in the term cache.
Parameters
EntityDocument$entityMust have an ID, and optionally any combination of terms as declared by the TermIndexEntry::TYPE_... constants.
Exceptions
InvalidArgumentExceptionwhen $entity does not have an ID.
Returns
boolean Success indicator

 
 deleteTermsOfEntity (EntityId $entityId)
 Deletes the terms of the provided entity from the term cache.
Parameters
EntityId$entityId
Returns
boolean Success indicator

 
 getTermsOfEntity (EntityId $entityId, array $termTypes=null, array $languageCodes=null)
 Returns the terms stored for the given entity.
Parameters
EntityId$entityId
string[] | null$termTypesThe 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$languageCodesThe desired languages, given as language codes. If null, all languages are returned.
Returns
TermIndexEntry[]

 
 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.
Parameters
EntityId[]$entityIdsEntity ids of one type only.
string[] | null$termTypesThe 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$languageCodesThe desired languages, given as language codes. If null, all languages are returned.
Returns
TermIndexEntry[]

 
 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.
Parameters
TermIndexSearchCriteria[]$criteria
string | string[] | null$termType
string | string[] | null$entityType
array$optionsAccepted options are:
  • caseSensitive: boolean, default true
  • prefixSearch: boolean, default false
  • LIMIT: int, defaults to none
  • orderByWeight: boolean, default false
Returns
TermIndexEntry[]

 
 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.
Parameters
TermIndexSearchCriteria[]$criteria
string | string[] | null$termType
string | string[] | null$entityType
array$optionsAccepted options are:
  • caseSensitive: boolean, default true
  • prefixSearch: boolean, default false
  • LIMIT: int, defaults to none
Returns
TermIndexEntry[]

 
 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.
Returns
boolean Success indicator

 

Detailed Description

TermIndex implementation that does nothing.

Deprecated:
As wb_terms is going away, See https://phabricator.wikimedia.org/T208425

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.

Member Function Documentation

◆ clear()

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.

Returns
boolean Success indicator

Implements Wikibase\Lib\Store\TermIndex.

◆ deleteTermsOfEntity()

Wikibase\Lib\Store\NullTermIndex::deleteTermsOfEntity ( EntityId  $entityId)

Deletes the terms of the provided entity from the term cache.

Parameters
EntityId$entityId
Returns
boolean Success indicator

Implements Wikibase\Lib\Store\EntityTermStoreWriter.

◆ getMatchingTerms()

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.

Parameters
TermIndexSearchCriteria[]$criteria
string | string[] | null$termType
string | string[] | null$entityType
array$optionsAccepted options are:
  • caseSensitive: boolean, default true
  • prefixSearch: boolean, default false
  • LIMIT: int, defaults to none
  • orderByWeight: boolean, default false
Returns
TermIndexEntry[]

Implements Wikibase\Lib\Store\MatchingTermsLookup.

◆ getTermsOfEntities()

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.

Parameters
EntityId[]$entityIdsEntity ids of one type only.
string[] | null$termTypesThe 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$languageCodesThe desired languages, given as language codes. If null, all languages are returned.
Returns
TermIndexEntry[]

Implements Wikibase\Lib\Store\LegacyEntityTermStoreReader.

◆ getTermsOfEntity()

Wikibase\Lib\Store\NullTermIndex::getTermsOfEntity ( EntityId  $entityId,
array  $termTypes = null,
array  $languageCodes = null 
)

Returns the terms stored for the given entity.

Parameters
EntityId$entityId
string[] | null$termTypesThe 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$languageCodesThe desired languages, given as language codes. If null, all languages are returned.
Returns
TermIndexEntry[]

Implements Wikibase\Lib\Store\LegacyEntityTermStoreReader.

◆ getTopMatchingTerms()

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.

Parameters
TermIndexSearchCriteria[]$criteria
string | string[] | null$termType
string | string[] | null$entityType
array$optionsAccepted options are:
  • caseSensitive: boolean, default true
  • prefixSearch: boolean, default false
  • LIMIT: int, defaults to none
Returns
TermIndexEntry[]

Implements Wikibase\Lib\Store\MatchingTermsLookup.

◆ saveTermsOfEntity()

Wikibase\Lib\Store\NullTermIndex::saveTermsOfEntity ( EntityDocument  $entity)

Saves the terms of the provided entity in the term cache.

Parameters
EntityDocument$entityMust have an ID, and optionally any combination of terms as declared by the TermIndexEntry::TYPE_... constants.
Exceptions
InvalidArgumentExceptionwhen $entity does not have an ID.
Returns
boolean Success indicator

Implements Wikibase\Lib\Store\EntityTermStoreWriter.


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