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

An acquirer and resolver for term type IDs implemented using a NameTableStore for wbt_type. More...

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

Public Member Functions

 __construct (RepoDomainDb $db, WANObjectCache $cache, LoggerInterface $logger=null)
 
 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.
Parameters
string[]$types
Returns
int[] array type names to type ids
} Unknown types will be associated with null in the value
 

Private Attributes

 $nameTableStore
 

Detailed Description

An acquirer and resolver for term type IDs implemented using a NameTableStore for wbt_type.

See also
Item & Property Terms

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\Sql\Terms\DatabaseTypeIdsStore::__construct ( RepoDomainDb $db,
WANObjectCache $cache,
LoggerInterface $logger = null )

Member Function Documentation

◆ acquireTypeIds()

Wikibase\Lib\Store\Sql\Terms\DatabaseTypeIdsStore::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\DatabaseTypeIdsStore::lookupTypeIds ( array $types)

{Lookup type ids for given type names.

Parameters
string[]$types
Returns
int[] array type names to type ids
} Unknown types will be associated with null in the value

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

◆ resolveTypeIds()

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

◆ $nameTableStore

Wikibase\Lib\Store\Sql\Terms\DatabaseTypeIdsStore::$nameTableStore
private

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