MediaWiki  master
MediaWiki\Deferred\LinksUpdate\TitleLinksTable Class Reference

An abstract base class for tables that link to local titles. More...

Inheritance diagram for MediaWiki\Deferred\LinksUpdate\TitleLinksTable:
Collaboration diagram for MediaWiki\Deferred\LinksUpdate\TitleLinksTable:

Public Member Functions

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

Protected Member Functions

 deduplicateLinkIds ( $linkIds)
 Given an iterator over link IDs, remove links which go to the same title, leaving only one link per title. More...
 
 getDeduplicatedLinkIds ( $setType)
 Get link IDs for a given set type, filtering out duplicate links to the same title. More...
 
 makePageReferenceValue ( $linkId)
 Convert a link ID to a PageReferenceValue. More...
 
 makeTitle ( $linkId)
 Convert a link ID to a Title. More...
 
- Protected Member Functions inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
 deleteLink ( $linkId)
 Delete a link identified by ID. More...
 
 deleteRow ( $conds)
 Queue a deletion operation. More...
 
 doWrites ()
 Do the common DB operations. More...
 
 fetchExistingRows ()
 Do a select query to fetch the existing rows. More...
 
 finishUpdate ()
 Subclasses can override this to do any updates associated with their link data, for example dispatching HTML update jobs. More...
 
 getBatchSize ()
 Get the maximum number of rows to update in a batch. More...
 
 getDB ()
 
 getExistingFields ()
 Get the fields to be used in fetchExistingRows(). More...
 
 getExistingLinkIDs ()
 Get an array (or iterator) of link IDs for the existing state. More...
 
 getFromConds ()
 Get field=>value associative array for the from field(s) More...
 
 getFromField ()
 Get the name of the field which links to page_id. More...
 
 getInsertOptions ()
 Get the options for the insert queries. More...
 
 getLBFactory ()
 
 getLinkIDs ( $setType)
 Get an array or iterator of link IDs of a given type. More...
 
 getMovedPage ()
 Assuming the page was moved, get the original page title before the move. More...
 
 getNewLinkIDs ()
 Get an array (or iterator) of link IDs for the new state. More...
 
 getRevision ()
 Get the RevisionRecord of the new revision, if the LinksUpdate caller injected one. More...
 
 getSourcePage ()
 Get the source page, i.e. More...
 
 getSourcePageId ()
 Get the page_id of the source page. More...
 
 getTableName ()
 Get the table name. More...
 
 getTransactionTicket ()
 Get the empty transaction ticket, or null if there is none. More...
 
 insertLink ( $linkId)
 Insert a link identified by ID. More...
 
 insertRow ( $row)
 Queue a row for insertion. More...
 
 isCrossNamespaceMove ()
 Determine whether the page was moved to a different namespace. More...
 
 isExisting ( $linkId)
 Determine whether a link (from the new set) is in the existing set. More...
 
 isInNewSet ( $linkId)
 Determine whether a link (from the existing set) is in the new set. More...
 
 isMove ()
 Determine whether the page was moved. More...
 
 linksTargetNormalizationStage ()
 Normalization stage of the links table (see T222224) More...
 
 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. More...
 
 startUpdate ()
 Subclasses can override this to do any necessary setup before individual write operations begin. More...
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
const CHANGED = 3
 Link type: Changed (inserted or removed) links. More...
 
const DELETED = 2
 Link type: Deleted (removed) links. More...
 
const INSERTED = 1
 Link type: Inserted (added) links. More...
 
const NEW = 5
 Link type: new links (from the ParserOutput) More...
 
const OLD = 4
 Link type: existing/old links. More...
 
- Protected Attributes inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
array $deletedLinks = []
 Link IDs for deleted links. More...
 
array $insertedLinks = []
 Link IDs for inserted links. More...
 
LinkTargetLookup $linkTargetLookup
 
array $rowsToDelete = []
 Rows to delete. More...
 
array $rowsToInsert = []
 Rows to insert. More...
 
bool $strictTestMode
 

Detailed Description

An abstract base class for tables that link to local titles.

Stability: stable
to extend
Since
1.38

Definition at line 14 of file TitleLinksTable.php.

Member Function Documentation

◆ deduplicateLinkIds()

MediaWiki\Deferred\LinksUpdate\TitleLinksTable::deduplicateLinkIds (   $linkIds)
abstractprotected

Given an iterator over link IDs, remove links which go to the same title, leaving only one link per title.

Parameters
iterable<mixed>$linkIds
Returns
iterable<mixed>

Reimplemented in MediaWiki\Deferred\LinksUpdate\ImageLinksTable, MediaWiki\Deferred\LinksUpdate\GenericPageLinksTable, and MediaWiki\Deferred\LinksUpdate\CategoryLinksTable.

◆ getDeduplicatedLinkIds()

MediaWiki\Deferred\LinksUpdate\TitleLinksTable::getDeduplicatedLinkIds (   $setType)
protected

Get link IDs for a given set type, filtering out duplicate links to the same title.

Parameters
int$setType
Returns
iterable<mixed>

Definition at line 51 of file TitleLinksTable.php.

◆ getPageReferenceIterator()

MediaWiki\Deferred\LinksUpdate\TitleLinksTable::getPageReferenceIterator (   $setType)

Get a link set as an iterator over PageReferenceValue objects.

Parameters
int$setType
Returns
iterable<PageReferenceValue>

Definition at line 83 of file TitleLinksTable.php.

◆ getTitleArray()

MediaWiki\Deferred\LinksUpdate\TitleLinksTable::getTitleArray (   $setType)

Get a link set as an array of Title objects.

This is memory-inefficient.

Deprecated:
since 1.38
Parameters
int$setType
Returns
Title[]

Definition at line 67 of file TitleLinksTable.php.

◆ makePageReferenceValue()

MediaWiki\Deferred\LinksUpdate\TitleLinksTable::makePageReferenceValue (   $linkId)
abstractprotected

Convert a link ID to a PageReferenceValue.

Parameters
mixed$linkId
Returns
PageReferenceValue

Reimplemented in MediaWiki\Deferred\LinksUpdate\ImageLinksTable, MediaWiki\Deferred\LinksUpdate\GenericPageLinksTable, and MediaWiki\Deferred\LinksUpdate\CategoryLinksTable.

◆ makeTitle()

MediaWiki\Deferred\LinksUpdate\TitleLinksTable::makeTitle (   $linkId)
protected

Convert a link ID to a Title.

Stability: stable
to override
Parameters
mixed$linkId
Returns
Title

Reimplemented in MediaWiki\Deferred\LinksUpdate\ImageLinksTable, MediaWiki\Deferred\LinksUpdate\GenericPageLinksTable, and MediaWiki\Deferred\LinksUpdate\CategoryLinksTable.

Definition at line 30 of file TitleLinksTable.php.


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