Wikibase
MediaWiki Wikibase extension
Wikibase\Lib\Store\Sql\EntityChangeLookup Class Reference

Allows accessing changes stored in a database. More...

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

Public Member Functions

 __construct (EntityChangeFactory $entityChangeFactory, EntityIdParser $entityIdParser, RepoDomainDb $db)
 
 getRecordId ( $rec)
 Returns the sequential ID of the given EntityChange. More...
 
 loadChunk ( $start, $size)
 
 loadByChangeIds (array $ids)
 
 loadByRevisionId ( $revisionId, $mode=self::FROM_REPLICA)
 

Public Attributes

const FROM_MASTER = 'master'
 Flag to indicate that we need to query a master database. More...
 
const FROM_REPLICA = 'replica'
 

Private Member Functions

 loadChanges (array $where, array $options, $method, $mode=DB_REPLICA)
 
 changesFromRows (IResultWrapper $rows)
 

Private Attributes

 $entityChangeFactory
 
 $entityIdParser
 
 $db
 

Detailed Description

Allows accessing changes stored in a database.

Author
Marius Hoch

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Lib\Store\Sql\EntityChangeLookup::__construct ( EntityChangeFactory  $entityChangeFactory,
EntityIdParser  $entityIdParser,
RepoDomainDb  $db 
)
Parameters
EntityChangeFactory$entityChangeFactory
EntityIdParser$entityIdParser
RepoDomainDb$db

Member Function Documentation

◆ changesFromRows()

Wikibase\Lib\Store\Sql\EntityChangeLookup::changesFromRows ( IResultWrapper  $rows)
private
Parameters
IResultWrapper$rows
Returns
EntityChange[]

◆ getRecordId()

Wikibase\Lib\Store\Sql\EntityChangeLookup::getRecordId (   $rec)

Returns the sequential ID of the given EntityChange.

Parameters
EntityChange$rec
Returns
int

Implements Wikibase\Lib\Store\ChunkAccess.

◆ loadByChangeIds()

Wikibase\Lib\Store\Sql\EntityChangeLookup::loadByChangeIds ( array  $ids)
Parameters
int[]$ids
Returns
EntityChange[]

◆ loadByRevisionId()

Wikibase\Lib\Store\Sql\EntityChangeLookup::loadByRevisionId (   $revisionId,
  $mode = self::FROM_REPLICA 
)
Parameters
int$revisionId
string$modeOne of the self::FROM_... constants.
Returns
EntityChange|null

◆ loadChanges()

Wikibase\Lib\Store\Sql\EntityChangeLookup::loadChanges ( array  $where,
array  $options,
  $method,
  $mode = DB_REPLICA 
)
private
Parameters
array$where
array$options
string$method
int$mode(DB_REPLICA or DB_PRIMARY)
Returns
EntityChange[]

◆ loadChunk()

Wikibase\Lib\Store\Sql\EntityChangeLookup::loadChunk (   $start,
  $size 
)
Parameters
int$start
int$size
Returns
EntityChange[]

Implements Wikibase\Lib\Store\ChunkAccess.

Member Data Documentation

◆ $db

Wikibase\Lib\Store\Sql\EntityChangeLookup::$db
private

◆ $entityChangeFactory

Wikibase\Lib\Store\Sql\EntityChangeLookup::$entityChangeFactory
private

◆ $entityIdParser

Wikibase\Lib\Store\Sql\EntityChangeLookup::$entityIdParser
private

◆ FROM_MASTER

const Wikibase\Lib\Store\Sql\EntityChangeLookup::FROM_MASTER = 'master'

Flag to indicate that we need to query a master database.

◆ FROM_REPLICA

const Wikibase\Lib\Store\Sql\EntityChangeLookup::FROM_REPLICA = 'replica'

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