Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup Class Reference
+ Inheritance diagram for Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup:
+ Collaboration diagram for Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup:

Public Member Functions

 __construct (MatchingTermsLookup $oldLookup, MatchingTermsLookup $newLookup, int $itemMigrationStage, int $propertyMigrationStage)
 
 getMatchingTerms (array $criteria, $termType=null, $entityType=null, array $options=[])
 Returns the terms that match the provided conditions. More...
 
 getTopMatchingTerms (array $criteria, $termType=null, $entityType=null, array $options=[])
 Returns the terms that match the provided conditions ranked with the 'most important' / top first. More...
 

Private Member Functions

 isRequestingOnlyTermsOfEntityType (string $entityType, $requestedEntityTypes)
 
 getStoreByMigrationStage (int $stage)
 
 shouldUseNewStore (int $stage)
 
 bothUseSameStore ()
 
 applyLimit (array $terms, $options)
 

Private Attributes

 $oldLookup
 
 $newLookup
 
 $itemMigrationStage
 
 $propertyMigrationStage
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::__construct ( MatchingTermsLookup  $oldLookup,
MatchingTermsLookup  $newLookup,
int  $itemMigrationStage,
int  $propertyMigrationStage 
)

Member Function Documentation

◆ applyLimit()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::applyLimit ( array  $terms,
  $options 
)
private

◆ bothUseSameStore()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::bothUseSameStore ( )
private

◆ getMatchingTerms()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::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.

◆ getStoreByMigrationStage()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::getStoreByMigrationStage ( int  $stage)
private

◆ getTopMatchingTerms()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::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.

◆ isRequestingOnlyTermsOfEntityType()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::isRequestingOnlyTermsOfEntityType ( string  $entityType,
  $requestedEntityTypes 
)
private

◆ shouldUseNewStore()

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::shouldUseNewStore ( int  $stage)
private

Member Data Documentation

◆ $itemMigrationStage

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::$itemMigrationStage
private

◆ $newLookup

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::$newLookup
private

◆ $oldLookup

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::$oldLookup
private

◆ $propertyMigrationStage

Wikibase\Lib\Store\Sql\Terms\TermStoreDelegatingMatchingTermsLookup::$propertyMigrationStage
private

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