MediaWiki master
MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable Class Reference

iwlinks More...

Inherits MediaWiki\Deferred\LinksUpdate\LinksTable.

Collaboration diagram for MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable:

Public Member Functions

 setParserOutput (ParserOutput $parserOutput)
 Subclasses should implement this to extract the data they need from the ParserOutput.
 
- Public Member Functions inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
 beforeLock ()
 Subclasses can override this to do any necessary setup before the lock is acquired.
 
 injectBaseDependencies (LBFactory $lbFactory, LinkTargetLookup $linkTargetLookup, PageIdentity $sourcePage, $batchSize)
 This is called by the factory to inject dependencies for the base class.
 
 setMoveDetails (PageReference $movedPage)
 Notify the object that the operation is a page move, and set the original title.
 
 setRevision (RevisionRecord $revision)
 Set the revision associated with the edit.
 
 setStrictTestMode ( $mode=true)
 Omit conflict resolution options from the insert query so that testing can confirm that the incremental update logic was correct.
 
 setTransactionTicket ( $ticket)
 Set the empty transaction ticket.
 
 update ()
 Execute an edit/delete update.
 

Public Attributes

const VIRTUAL_DOMAIN = 'virtual-interwikilinks'
 
- Public Attributes inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
const CHANGED = 3
 Link type: Changed (inserted or removed) links.
 
const DELETED = 2
 Link type: Deleted (removed) links.
 
const INSERTED = 1
 Link type: Inserted (added) links.
 
const NEW = 5
 Link type: new links (from the ParserOutput)
 
const OLD = 4
 Link type: existing/old links.
 

Protected Member Functions

 deleteLink ( $linkId)
 Delete a link identified by ID.The subclass is expected to queue the deletion by calling deleteRow().
Parameters
mixed$linkId

 
 getExistingFields ()
 Get the fields to be used in fetchExistingRows().Note that fetchExistingRows() is just a helper for subclasses. The value returned here is effectively private to the subclass.
Returns
array

 
 getExistingLinkIDs ()
 Get an array (or iterator) of link IDs for the existing state.The subclass should load the data from the database. There is fetchExistingRows() to make this easier but the subclass is responsible for caching.See the LinksTable doc comment for an explanation of link IDs.
Returns
iterable<mixed>

 
 getFromField ()
 Get the name of the field which links to page_id.
Returns
string

 
 getNewLinkIDs ()
 Get an array (or iterator) of link IDs for the new state.See the LinksTable doc comment for an explanation of link IDs.
Returns
iterable<mixed>

 
 getTableName ()
 Get the table name.
Returns
string

 
 getVirtualDomain ()
 
 insertLink ( $linkId)
 Insert a link identified by ID.The subclass is expected to queue the insertion by calling insertRow().
Parameters
mixed$linkId

 
 isExisting ( $linkId)
 Determine whether a link (from the new set) is in the existing set.
Parameters
mixed$linkId
Returns
bool

 
 isInNewSet ( $linkId)
 Determine whether a link (from the existing set) is in the new set.
Parameters
mixed$linkId
Returns
bool

 
- Protected Member Functions inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
 deleteRow ( $conds)
 Queue a deletion operation.
 
 doWrites ()
 Do the common DB operations.
 
 fetchExistingRows ()
 Do a select query to fetch the existing rows.
 
 finishUpdate ()
 Subclasses can override this to do any updates associated with their link data, for example dispatching HTML update jobs.
 
 getBatchSize ()
 Get the maximum number of rows to update in a batch.
 
 getDB ()
 
 getFromConds ()
 Get field=>value associative array for the from field(s)
 
 getInsertOptions ()
 Get the options for the insert queries.
 
 getLBFactory ()
 
 getLinkIDs ( $setType)
 Get an array or iterator of link IDs of a given type.
 
 getMovedPage ()
 Assuming the page was moved, get the original page title before the move.
 
 getRevision ()
 Get the RevisionRecord of the new revision, if the LinksUpdate caller injected one.
 
 getSourcePage ()
 Get the source page, i.e.
 
 getSourcePageId ()
 Get the page_id of the source page.
 
 getTransactionTicket ()
 Get the empty transaction ticket, or null if there is none.
 
 insertRow ( $row)
 Queue a row for insertion.
 
 isCrossNamespaceMove ()
 Determine whether the page was moved to a different namespace.
 
 isMove ()
 Determine whether the page was moved.
 
 linksTargetNormalizationStage ()
 Normalization stage of the links table (see T222224)
 
 needForcedLinkRefresh ()
 Subclasses can override this to return true in order to force reinsertion of all the links due to some property of the link changing for reasons not represented by the link ID.
 
 startUpdate ()
 Subclasses can override this to do any necessary setup before individual write operations begin.
 
 virtualDomain ()
 What virtual domain should be used to read/write from the table.
 

Additional Inherited Members

- Protected Attributes inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
array $deletedLinks = []
 Link IDs for deleted links.
 
array $insertedLinks = []
 Link IDs for inserted links.
 
LinkTargetLookup $linkTargetLookup
 
array $rowsToDelete = []
 Rows to delete.
 
array $rowsToInsert = []
 Rows to insert.
 
bool $strictTestMode
 

Detailed Description

iwlinks

Link ID format: string[]

  • 0: Interwiki prefix
  • 1: Foreign title
Since
1.38

Definition at line 17 of file InterwikiLinksTable.php.

Member Function Documentation

◆ deleteLink()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::deleteLink ( $linkId)
protected

Delete a link identified by ID.The subclass is expected to queue the deletion by calling deleteRow().

Parameters
mixed$linkId

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 108 of file InterwikiLinksTable.php.

References MediaWiki\Deferred\LinksUpdate\LinksTable\deleteRow().

◆ getExistingFields()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::getExistingFields ( )
protected

Get the fields to be used in fetchExistingRows().Note that fetchExistingRows() is just a helper for subclasses. The value returned here is effectively private to the subclass.

Returns
array

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 47 of file InterwikiLinksTable.php.

◆ getExistingLinkIDs()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::getExistingLinkIDs ( )
protected

Get an array (or iterator) of link IDs for the existing state.The subclass should load the data from the database. There is fetchExistingRows() to make this easier but the subclass is responsible for caching.See the LinksTable doc comment for an explanation of link IDs.

Returns
iterable<mixed>

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 77 of file InterwikiLinksTable.php.

◆ getFromField()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::getFromField ( )
protected

Get the name of the field which links to page_id.

Returns
string

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 42 of file InterwikiLinksTable.php.

◆ getNewLinkIDs()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::getNewLinkIDs ( )
protected

Get an array (or iterator) of link IDs for the new state.See the LinksTable doc comment for an explanation of link IDs.

Returns
iterable<mixed>

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 52 of file InterwikiLinksTable.php.

◆ getTableName()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::getTableName ( )
protected

Get the table name.

Returns
string

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 37 of file InterwikiLinksTable.php.

◆ getVirtualDomain()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::getVirtualDomain ( )
protected

◆ insertLink()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::insertLink ( $linkId)
protected

Insert a link identified by ID.The subclass is expected to queue the insertion by calling insertRow().

Parameters
mixed$linkId

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 99 of file InterwikiLinksTable.php.

References MediaWiki\Deferred\LinksUpdate\LinksTable\insertRow().

◆ isExisting()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::isExisting ( $linkId)
protected

Determine whether a link (from the new set) is in the existing set.

Parameters
mixed$linkId
Returns
bool

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 86 of file InterwikiLinksTable.php.

◆ isInNewSet()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::isInNewSet ( $linkId)
protected

Determine whether a link (from the existing set) is in the new set.

Parameters
mixed$linkId
Returns
bool

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 93 of file InterwikiLinksTable.php.

◆ setParserOutput()

MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::setParserOutput ( ParserOutput $parserOutput)

Subclasses should implement this to extract the data they need from the ParserOutput.

To support a future refactor of LinksDeletionUpdate, if this method is not called, the subclass should assume that the new state is empty.

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 26 of file InterwikiLinksTable.php.

References MediaWiki\Parser\ParserOutput\getLinkList().

Member Data Documentation

◆ VIRTUAL_DOMAIN

const MediaWiki\Deferred\LinksUpdate\InterwikiLinksTable::VIRTUAL_DOMAIN = 'virtual-interwikilinks'

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