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

Accessor that can dispatch to internal Accessors based on the entity type of IDs provided. More...

+ Inheritance diagram for Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor:
+ Collaboration diagram for Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor:

Public Member Functions

 __construct (array $instansiators, WikiPageEntityMetaDataAccessor $defaultAccessor, $databaseName, $repositoryName)
 
 loadRevisionInformation (array $entityIds, $mode)
 
 loadRevisionInformationByRevisionId (EntityId $entityId, $revisionId, $mode=LookupConstants::LATEST_FROM_MASTER)
 
 loadLatestRevisionIds (array $entityIds, $mode)
 

Private Member Functions

 groupIdsByType (array $entityIds)
 
 getAccessor ( $entityType)
 

Private Attributes

 $accessors
 
 $defaultAccessor
 
 $databaseName
 
 $repositoryName
 

Detailed Description

Accessor that can dispatch to internal Accessors based on the entity type of IDs provided.

As the accessor includes batched access this class will batch entity IDs by type before using the internal accessors. This is needed as the EntityMetaDataAccessor implements queries against the page table base on entity IDs that won't work for all entities.

Author
Addshore

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::__construct ( array $instansiators,
WikiPageEntityMetaDataAccessor $defaultAccessor,
$databaseName,
$repositoryName )
Parameters
callable[] | WikiPageEntityMetaDataAccessor[]$instansiatorsAn associative array mapping entity types to instansiator callbacks. Callback signature: function( $databaseName, $repositoryName ): WikiPageEntityMetaDataAccessor Parameter Types: string|false $databaseName, string $repositoryName
WikiPageEntityMetaDataAccessor$defaultAccessor
string | false$databaseName
string$repositoryName

Member Function Documentation

◆ getAccessor()

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::getAccessor ( $entityType)
private
Parameters
string$entityType
Exceptions
InvalidArgumentException
Returns
WikiPageEntityMetaDataAccessor

◆ groupIdsByType()

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::groupIdsByType ( array $entityIds)
private
Parameters
EntityId[]$entityIds
Returns
array[]

◆ loadLatestRevisionIds()

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::loadLatestRevisionIds ( array $entityIds,
$mode )
See also
WikiPageEntityMetaDataAccessor::loadLatestRevisionIds
Parameters
EntityId[]$entityIds
string$mode( LookupConstants::LATEST_FROM_REPLICA, LookupConstants::LATEST_FROM_REPLICA_WITH_FALLBACK or LookupConstants::LATEST_FROM_MASTER)
Returns
(int|bool)[] Array mapping entity ID serializations to either revision IDs or false if an entity could not be found (including if the page is a redirect).

Implements Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor.

◆ loadRevisionInformation()

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::loadRevisionInformation ( array $entityIds,
$mode )
See also
WikiPageEntityMetaDataAccessor::loadRevisionInformation
Parameters
EntityId[]$entityIds
string$mode( LookupConstants::LATEST_FROM_REPLICA, LookupConstants::LATEST_FROM_REPLICA_WITH_FALLBACK or LookupConstants::LATEST_FROM_MASTER)
Returns
(stdClass|bool)[] Array mapping entity ID serializations to either objects or false if an entity could not be found.

Implements Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor.

◆ loadRevisionInformationByRevisionId()

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::loadRevisionInformationByRevisionId ( EntityId $entityId,
$revisionId,
$mode = LookupConstants::LATEST_FROM_MASTER )
See also
WikiPageEntityMetaDataAccessor::loadRevisionInformationByRevisionId
Parameters
EntityId$entityId
int$revisionIdRevision id to fetch data about, must be an integer greater than 0.
string$mode( LookupConstants::LATEST_FROM_REPLICA, LookupConstants::LATEST_FROM_REPLICA_WITH_FALLBACK or LookupConstants::LATEST_FROM_MASTER).
Returns
stdClass|bool false if no such entity exists

Implements Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor.

Member Data Documentation

◆ $accessors

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::$accessors
private

◆ $databaseName

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::$databaseName
private

◆ $defaultAccessor

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::$defaultAccessor
private

◆ $repositoryName

Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor::$repositoryName
private

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