Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
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, $wiki=false)
 
 getRecordId ( $rec)
 Returns the sequential ID of the given EntityChange.
 
 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.
 
const FROM_REPLICA = 'replica'
 

Private Member Functions

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

Private Attributes

 $entityChangeFactory
 
 $entityIdParser
 

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,
  $wiki = false 
)
Parameters
EntityChangeFactory$entityChangeFactory
EntityIdParser$entityIdParser
string | bool$wikiThe target wiki's name. This must be an ID that LBFactory can understand.

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_MASTER)
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

◆ $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: