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

Abstract PageTableEntityQuery implementation allowing simple mapping between rows and entity IDs using one or more fields and some simple logic. More...

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

Public Member Functions

 __construct (EntityNamespaceLookup $entityNamespaceLookup, NameTableStore $slotRoleStore)
 
 selectRows (array $fields, ?array $revisionJoinConds, array $entityIds, IReadableDatabase $db)
 

Protected Member Functions

 getConditionForEntityId (EntityId $entityId)
 
 getEntityIdStringFromRow (stdClass $row)
 
 getFieldsNeededForMapping ()
 

Private Member Functions

 updateQueryBuilder (SelectQueryBuilder $queryBuilder, array $entityIds, IReadableDatabase $db)
 
 indexRowsByEntityId (Traversable $rows)
 

Private Attributes

EntityNamespaceLookup $entityNamespaceLookup
 
NameTableStore $slotRoleStore
 

Detailed Description

Abstract PageTableEntityQuery implementation allowing simple mapping between rows and entity IDs using one or more fields and some simple logic.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::__construct ( EntityNamespaceLookup $entityNamespaceLookup,
NameTableStore $slotRoleStore )

Member Function Documentation

◆ getConditionForEntityId()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::getConditionForEntityId ( EntityId $entityId)
abstractprotected
Parameters
EntityId$entityId
Returns
array SQL condition

Reimplemented in Wikibase\Lib\Store\Sql\EntityIdLocalPartPageTableEntityQuery.

◆ getEntityIdStringFromRow()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::getEntityIdStringFromRow ( stdClass $row)
abstractprotected
Parameters
stdClass$row
Returns
string serialization of an entity ID for example Q123

Reimplemented in Wikibase\Lib\Store\Sql\EntityIdLocalPartPageTableEntityQuery.

◆ getFieldsNeededForMapping()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::getFieldsNeededForMapping ( )
abstractprotected
Returns
string[] Extra fields needed for the mapping done in mapRowsToEntityIds

Reimplemented in Wikibase\Lib\Store\Sql\EntityIdLocalPartPageTableEntityQuery.

◆ indexRowsByEntityId()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::indexRowsByEntityId ( Traversable $rows)
private
Parameters
Traversable$rows
Returns
stdClass[] Array of rows with keys of their entity ID serializations

◆ selectRows()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::selectRows ( array $fields,
?array $revisionJoinConds,
array $entityIds,
IReadableDatabase $db )
Parameters
array$fieldsFields to select
array | null$revisionJoinCondsIf non-null, perform an INNER JOIN against the revision table on these join conditions.
EntityId[]$entityIdsEntityIds to select
IReadableDatabase$dbDB to query on
Returns
stdClass[] Array of rows with keys of their entity ID serializations

Implements Wikibase\Lib\Store\Sql\PageTableEntityQuery.

◆ updateQueryBuilder()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::updateQueryBuilder ( SelectQueryBuilder $queryBuilder,
array $entityIds,
IReadableDatabase $db )
private
Parameters
SelectQueryBuilder$queryBuilder
EntityId[]$entityIds
IReadableDatabase$db

Only check against the slot role when we are not using the main slot. If we are using the main slot, then we only need to check that the page exists rather than a specific slot within the page. This ensures comparability with the pre MCR schema as long as only the main slot is used.

Member Data Documentation

◆ $entityNamespaceLookup

EntityNamespaceLookup Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::$entityNamespaceLookup
private

◆ $slotRoleStore

NameTableStore Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::$slotRoleStore
private

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