Wikibase
MediaWiki Wikibase extension
|
Service for looking up 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...
Public Member Functions | |
__construct (EntityNamespaceLookup $entityNamespaceLookup, PageTableEntityQuery $pageTableEntityConditionGenerator, DatabaseEntitySource $entitySource, RepoDomainDb $repoDb, LoggerInterface $logger=null) | |
loadRevisionInformationByRevisionId (EntityId $entityId, $revisionId, $mode=LookupConstants::LATEST_FROM_MASTER) | |
Public Member Functions inherited from 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. | |
loadLatestRevisionIds (array $entityIds, $mode) | |
Looks up the latest revision ID(s) for the given entityId(s). | |
Private Member Functions | |
assertCanHandleEntityIds (array $entityIds) | |
assertCanHandleEntityId (EntityId $entityId) | |
selectFields () | |
Fields we need to select to load a revision. | |
selectRevisionInformationById (EntityId $entityId, int $revisionId, IReadableDatabase $db) | |
Selects revision information from the page and revision tables. | |
selectRevisionInformationMultiple (array $entityIds, IReadableDatabase $db) | |
Selects revision information from the page and revision tables. | |
selectLatestRevisionIdsMultiple (array $entityIds, IReadableDatabase $db) | |
Selects page_latest information from the page table. | |
processRows (array $entityIds, array $rows) | |
Takes an array of rows and returns a result where every given entity ID has some value. | |
Private Attributes | |
EntityNamespaceLookup | $entityNamespaceLookup |
PageTableEntityQuery | $pageTableEntityQuery |
LoggerInterface | $logger |
DatabaseEntitySource | $entitySource |
RepoDomainDb | $repoDb |
Service for looking up 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.
This lookup makes the assumption that the page title storing the entity matches the local ID part of the entity ID as this class queries against the page_title field of the page table.
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::__construct | ( | EntityNamespaceLookup | $entityNamespaceLookup, |
PageTableEntityQuery | $pageTableEntityConditionGenerator, | ||
DatabaseEntitySource | $entitySource, | ||
RepoDomainDb | $repoDb, | ||
LoggerInterface | $logger = null ) |
|
private |
|
private |
EntityId[] | $entityIds |
InvalidArgumentException | When some of $entityIds cannot be handled by this lookup |
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::loadRevisionInformationByRevisionId | ( | EntityId | $entityId, |
$revisionId, | |||
$mode = LookupConstants::LATEST_FROM_MASTER ) |
EntityId | $entityId | |
int | $revisionId | |
string | $mode | (WikiPageEntityMetaDataAccessor::LATEST_FROM_REPLICA, WikiPageEntityMetaDataAccessor::LATEST_FROM_REPLICA_WITH_FALLBACK or WikiPageEntityMetaDataAccessor::LATEST_FROM_MASTER) |
DBQueryError | |
InvalidArgumentException | When $entityId does not belong the repository of this lookup |
Implements Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor.
|
private |
Takes an array of rows and returns a result where every given entity ID has some value.
EntityId[] | $entityIds | |
stdClass[] | $rows | indexed by entity id serialization |
|
private |
Fields we need to select to load a revision.
|
private |
Selects page_latest information from the page table.
Returns an array like entityid -> int or false (if not found).
EntityId[] | $entityIds | The entities to query the DB for. |
IReadableDatabase | $db | connection to the DB_REPLICA or DB_PRIMARY database to query from (only “read” methods are used in either case) |
DBQueryError | If the query fails. |
|
private |
Selects revision information from the page and revision tables.
EntityId | $entityId | The entity to query the DB for. |
int | $revisionId | The desired revision id |
IReadableDatabase | $db | A connection to either DB_REPLICA or DB_PRIMARY (only “read” methods are used in either case) |
DBQueryError | If the query fails. |
|
private |
Selects revision information from the page and revision tables.
Returns an array like entityid -> object or false (if not found).
EntityId[] | $entityIds | The entities to query the DB for. |
IReadableDatabase | $db | connection to DB_REPLICA or DB_PRIMARY database to query (only “read” methods are used in either case) |
DBQueryError | If the query fails. |
|
private |
|
private |
|
private |
|
private |
|
private |