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...
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.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
-
Marius Hoch < hoo@o.nosp@m.nlin.nosp@m.e.de >
◆ __construct()
◆ assertCanHandleEntityId()
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::assertCanHandleEntityId |
( |
EntityId |
$entityId | ) |
|
|
private |
◆ assertCanHandleEntityIds()
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::assertCanHandleEntityIds |
( |
array |
$entityIds | ) |
|
|
private |
- Parameters
-
- Exceptions
-
InvalidArgumentException | When some of $entityIds cannot be handled by this lookup |
◆ loadRevisionInformationByRevisionId()
- Parameters
-
EntityId | $entityId | |
int | $revisionId | |
string | $mode | (WikiPageEntityMetaDataAccessor::LATEST_FROM_REPLICA, WikiPageEntityMetaDataAccessor::LATEST_FROM_REPLICA_WITH_FALLBACK or WikiPageEntityMetaDataAccessor::LATEST_FROM_MASTER) |
- Exceptions
-
DBQueryError | |
InvalidArgumentException | When $entityId does not belong the repository of this lookup |
- Returns
- stdClass|bool
Implements Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataAccessor.
◆ processRows()
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::processRows |
( |
array |
$entityIds, |
|
|
array |
$rows |
|
) |
| |
|
private |
Takes an array of rows and returns a result where every given entity ID has some value.
- Parameters
-
EntityId[] | $entityIds | |
stdClass[] | $rows | indexed by entity id serialization |
- Returns
- (stdClass|false)[] Array mapping entity ID serializations to either objects or false if an entity is not present in $res.
◆ selectFields()
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::selectFields |
( |
| ) |
|
|
private |
Fields we need to select to load a revision.
- Returns
- string[]
◆ selectLatestRevisionIdsMultiple()
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::selectLatestRevisionIdsMultiple |
( |
array |
$entityIds, |
|
|
IDatabase |
$db |
|
) |
| |
|
private |
Selects page_latest information from the page table.
Returns an array like entityid -> int or false (if not found).
- Parameters
-
EntityId[] | $entityIds | The entities to query the DB for. |
IDatabase | $db | connection to the DB_REPLICA or DB_PRIMARY database to query from |
- Exceptions
-
DBQueryError | If the query fails. |
- Returns
- array Array mapping entity ID serializations to either ints or false if an entity could not be found (including if the page is a redirect).
◆ selectRevisionInformationById()
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::selectRevisionInformationById |
( |
EntityId |
$entityId, |
|
|
int |
$revisionId, |
|
|
IDatabase |
$db |
|
) |
| |
|
private |
Selects revision information from the page and revision tables.
- Parameters
-
EntityId | $entityId | The entity to query the DB for. |
int | $revisionId | The desired revision id |
IDatabase | $db | A connection to either DB_REPLICA or DB_PRIMARY |
- Exceptions
-
DBQueryError | If the query fails. |
- Returns
- stdClass|bool a raw database row object, or false if no such entity revision exists.
◆ selectRevisionInformationMultiple()
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::selectRevisionInformationMultiple |
( |
array |
$entityIds, |
|
|
IDatabase |
$db |
|
) |
| |
|
private |
Selects revision information from the page and revision tables.
Returns an array like entityid -> object or false (if not found).
- Parameters
-
EntityId[] | $entityIds | The entities to query the DB for. |
IDatabase | $db | connection to DB_REPLICA or DB_PRIMARY database to query |
- Exceptions
-
DBQueryError | If the query fails. |
- Returns
- (stdClass|false)[] Array mapping entity ID serializations to either objects or false if an entity could not be found.
◆ $entityNamespaceLookup
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::$entityNamespaceLookup |
|
private |
◆ $entitySource
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::$entitySource |
|
private |
◆ $logger
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::$logger |
|
private |
◆ $pageTableEntityQuery
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::$pageTableEntityQuery |
|
private |
◆ $repoDb
Wikibase\Lib\Store\Sql\WikiPageEntityMetaDataLookup::$repoDb |
|
private |
The documentation for this class was generated from the following file: