Wikibase
MediaWiki Wikibase extension
|
Consumers acquire ids for stored terms to be used to link entities to these terms. More...
Public Member Functions | |
acquireTermInLangIds (array $termsArray, $callback=null) | |
Acquires IDs for the given terms. | |
Consumers acquire ids for stored terms to be used to link entities to these terms.
Wikibase\Lib\Store\Sql\Terms\TermInLangIdsAcquirer::acquireTermInLangIds | ( | array | $termsArray, |
$callback = null ) |
Acquires IDs for the given terms.
The acquirer guarantees that an in-parallel TermStoreCleaner
will not result in deleting terms that have been acquired by this acquirer, should these two in-parallel processes happen to overlap on some existing term in lang IDs. The mechanism of achieving this guarantee is complete under the following two conditions:
array | $termsArray | array containing terms per type per language. Example: [ 'label' => [ 'en' => 'some label', 'de' => 'another label', ... ], 'alias' => [ 'en' => [ 'alias', 'another alias', ...], 'de' => 'de alias', ... ], ... ] |
callable | null | $callback | Called with int[] $termInLangIds right before attempting to restore any of those acquired IDs that might have been deleted by another process before acquireTermInLangIds() has returned. |
Implemented in Wikibase\Lib\Store\Sql\Terms\DatabaseTermInLangIdsAcquirer, and Wikibase\Lib\Store\Sql\Terms\InMemoryTermStore.