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 $joins, array $entityIds, IDatabase $db)
 

Protected Member Functions

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

Private Member Functions

 getQueryInfo (array $entityIds, IDatabase $db)
 
 indexRowsByEntityId (Traversable $rows)
 

Private Attributes

 $entityNamespaceLookup
 
 $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.

◆ getQueryInfo()

Wikibase\Lib\Store\Sql\PageTableEntityQueryBase::getQueryInfo ( array  $entityIds,
IDatabase  $db 
)
private
Parameters
EntityId[]$entityIds
IDatabase$db
Returns
array [ string $whereCondition, array $extraTables ]

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.

◆ 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  $joins,
array  $entityIds,
IDatabase  $db 
)
Parameters
array$fieldsFields to select
array$joinsJoins to use, Keys must be table names.
EntityId[]$entityIdsEntityIds to select
IDatabase$dbDB to query on
Returns
stdClass[] Array of rows with keys of their entity ID serializations

Implements Wikibase\Lib\Store\Sql\PageTableEntityQuery.

Member Data Documentation

◆ $entityNamespaceLookup

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

◆ $slotRoleStore

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

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