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

An ItemTermStoreWriter wrapping several other ItemTermStoreWriters, dispatching to them based on the numeric item ID: each range is assigned one store that’s responsible writing. More...

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

Public Member Functions

 __construct (array $itemTermStoreWriters, $errorIfNoStoreForId=true)
 
 storeTerms (ItemId $itemId, Fingerprint $terms)
 
 deleteTerms (ItemId $itemId)
 

Private Member Functions

 getItemTermStoreWriter (ItemId $itemId)
 

Private Attributes

 $itemTermStoreWriters
 
 $errorIfNoStoreForId
 

Detailed Description

An ItemTermStoreWriter wrapping several other ItemTermStoreWriters, dispatching to them based on the numeric item ID: each range is assigned one store that’s responsible writing.

This class was originally intended to dispatch between both new and old stores but one instance of this class is now used for each new and old stores. As a result only the ID restricting logic is now used.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\ByIdDispatchingItemTermStoreWriter::__construct ( array  $itemTermStoreWriters,
  $errorIfNoStoreForId = true 
)
Parameters
ItemTermStoreWriter[]$itemTermStoreWritersMap from maximum item ID number to ItemTermStoreWriter for those IDs. The dispatcher iterates over this array, dispatching to the first store whose key is greater than or equal to the numeric item ID for which the store is called. It orders the key entries so the lowest one wins first. At least one of the keys must cover all possible IDs. Example:

[ 1000000 => $newStore, 2000000 => $mixedStore, Int32EntityId::MAX => $oldStore ]

Member Function Documentation

◆ deleteTerms()

Wikibase\Lib\Store\ByIdDispatchingItemTermStoreWriter::deleteTerms ( ItemId  $itemId)

◆ getItemTermStoreWriter()

Wikibase\Lib\Store\ByIdDispatchingItemTermStoreWriter::getItemTermStoreWriter ( ItemId  $itemId)
private

◆ storeTerms()

Wikibase\Lib\Store\ByIdDispatchingItemTermStoreWriter::storeTerms ( ItemId  $itemId,
Fingerprint  $terms 
)

Member Data Documentation

◆ $errorIfNoStoreForId

Wikibase\Lib\Store\ByIdDispatchingItemTermStoreWriter::$errorIfNoStoreForId
private

◆ $itemTermStoreWriters

Wikibase\Lib\Store\ByIdDispatchingItemTermStoreWriter::$itemTermStoreWriters
private

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