Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor Interface Reference

Interface for services giving access to meta data about one or more entities as needed for loading entities from WikiPages (via Revision) or to verify an entity against page.page_latest. More...

+ Inheritance diagram for Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor:

Public Member Functions

 loadRevisionInformation (array $entityIds, $mode)
 Looks up meta data for the given entityId(s) as needed to lookup the latest revision id of an entity or to load entity content from a MediaWiki revision.
 
 loadRevisionInformationByRevisionId (EntityId $entityId, $revisionId, $mode=LookupConstants::LATEST_FROM_MASTER)
 Looks up meta data for the given entityId-revisionId pair as needed to lookup the latest revision of the entity or to load entity content from a MediaWiki revision.
 
 loadLatestRevisionIds (array $entityIds, $mode)
 Looks up the latest revision ID(s) for the given entityId(s).
 

Detailed Description

Interface for services giving access to meta data about one or more entities as needed for loading entities from WikiPages (via Revision) or to verify an entity against page.page_latest.

Todo
This whole interface may no longer be needed with the introduction of RevisionRecord which can represent a revision on any wiki. MetaData accessing can probably be killed and instead RevisionRecord just be returned.
Author
Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >

Member Function Documentation

◆ loadLatestRevisionIds()

Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor::loadLatestRevisionIds ( array $entityIds,
$mode )

Looks up the latest revision ID(s) for the given entityId(s).

Returns an array of integer revision IDs

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).

Implemented in Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor, and Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor.

◆ loadRevisionInformation()

Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor::loadRevisionInformation ( array $entityIds,
$mode )

Looks up meta data for the given entityId(s) as needed to lookup the latest revision id of an entity or to load entity content from a MediaWiki revision.

Returns an array of stdClass with the following fields: 'rev_id', 'rev_timestamp', 'page_latest'.

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.

Implemented in Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor, and Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor.

◆ loadRevisionInformationByRevisionId()

Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor::loadRevisionInformationByRevisionId ( EntityId $entityId,
$revisionId,
$mode = LookupConstants::LATEST_FROM_MASTER )

Looks up meta data for the given entityId-revisionId pair as needed to lookup the latest revision of the entity or to load entity content from a MediaWiki revision.

Included fields are 'rev_id', 'rev_timestamp', 'page_latest'. Given that revision are immutable, this function will always try to load a revision from replica first and only use the master (with LookupConstants::LATEST_FROM_REPLICA_WITH_FALLBACK or LookupConstants::LATEST_FROM_MASTER) in case the revision couldn't be found.

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

Implemented in Wikibase\Lib\Store\Sql\PrefetchingWikiPageEntityMetaDataAccessor, Wikibase\Lib\Store\Sql\TypeDispatchingWikiPageEntityMetaDataAccessor, and Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup.


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