Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore Class Reference

Acquires and resolves unique and constant ids of types, stored in memory. More...

+ Inheritance diagram for Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore:
+ Collaboration diagram for Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore:

Public Member Functions

 acquireTypeIds (array $types)
 Acquires ids of stored types, persisting the ones that do not exist yet.
 
 resolveTypeIds (array $typeIds)
 Resolves types for the given type IDs.
 
 lookupTypeIds (array $types)
 Lookup type ids for given type names.
 

Private Attributes

 $types = []
 
 $lastId = 0
 

Detailed Description

Acquires and resolves unique and constant ids of types, stored in memory.

Member Function Documentation

◆ acquireTypeIds()

Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore::acquireTypeIds ( array $types)

Acquires ids of stored types, persisting the ones that do not exist yet.

Parameters
array$typeslist of types to acquire ids for
Returns
array keys in returned array are the types passed in $types associated with their acquired ids. Example: $typeIdsAcquirer->acquireTypeIds ( [ 'label', 'description' ] ) would return: [ 'label' => 100, 'description' => 121 ]

Implements Wikibase\Lib\Store\Sql\Terms\TypeIdsAcquirer.

◆ lookupTypeIds()

Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore::lookupTypeIds ( array $types)

Lookup type ids for given type names.

Parameters
string[]$types
Returns
int[] array type names to type ids

Implements Wikibase\Lib\Store\Sql\Terms\TypeIdsLookup.

◆ resolveTypeIds()

Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore::resolveTypeIds ( array $typeIds)

Resolves types for the given type IDs.

Parameters
int[]$typeIds
Returns
string[] Array from type IDs to type names. Unknown IDs in $typeIds are omitted.

Implements Wikibase\Lib\Store\Sql\Terms\TypeIdsResolver.

Member Data Documentation

◆ $lastId

Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore::$lastId = 0
private

◆ $types

Wikibase\Lib\Store\Sql\Terms\InMemoryTypeIdsStore::$types = []
private

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