MediaWiki REL1_39
|
An abstract base class for tables that link to local titles. More...
Public Member Functions | |
getPageReferenceIterator ( $setType) | |
Get a link set as an iterator over PageReferenceValue objects. | |
getTitleArray ( $setType) | |
Get a link set as an array of Title objects. | |
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, $afterUpdateHook) | |
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. | |
setParserOutput (ParserOutput $parserOutput) | |
Subclasses should implement this to extract the data they need from the ParserOutput. | |
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. | |
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. | |
getDeduplicatedLinkIds ( $setType) | |
Get link IDs for a given set type, filtering out duplicate links to the same title. | |
makePageReferenceValue ( $linkId) | |
Convert a link ID to a PageReferenceValue. | |
makeTitle ( $linkId) | |
Convert a link ID to a Title. | |
Protected Member Functions inherited from MediaWiki\Deferred\LinksUpdate\LinksTable | |
deleteLink ( $linkId) | |
Delete a link identified by ID. | |
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 () | |
getExistingFields () | |
Get the fields to be used in fetchExistingRows(). | |
getExistingLinkIDs () | |
Get an array (or iterator) of link IDs for the existing state. | |
getFromConds () | |
Get field=>value associative array for the from field(s) | |
getFromField () | |
Get the name of the field which links to page_id. | |
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. | |
getNewLinkIDs () | |
Get an array (or iterator) of link IDs for the new state. | |
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. | |
getTableName () | |
Get the table name. | |
getTransactionTicket () | |
Get the empty transaction ticket, or null if there is none. | |
insertLink ( $linkId) | |
Insert a link identified by ID. | |
insertRow ( $row) | |
Queue a row for insertion. | |
isCrossNamespaceMove () | |
Determine whether the page was moved to a different namespace. | |
isExisting ( $linkId) | |
Determine whether a link (from the new set) is in the existing set. | |
isInNewSet ( $linkId) | |
Determine whether a link (from the existing set) is in the new set. | |
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. | |
Additional Inherited Members | |
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 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 |
An abstract base class for tables that link to local titles.
Definition at line 14 of file TitleLinksTable.php.
|
abstractprotected |
Given an iterator over link IDs, remove links which go to the same title, leaving only one link per title.
iterable<mixed> | $linkIds |
Reimplemented in MediaWiki\Deferred\LinksUpdate\CategoryLinksTable, MediaWiki\Deferred\LinksUpdate\GenericPageLinksTable, and MediaWiki\Deferred\LinksUpdate\ImageLinksTable.
|
protected |
Get link IDs for a given set type, filtering out duplicate links to the same title.
int | $setType |
Definition at line 51 of file TitleLinksTable.php.
MediaWiki\Deferred\LinksUpdate\TitleLinksTable::getPageReferenceIterator | ( | $setType | ) |
Get a link set as an iterator over PageReferenceValue objects.
int | $setType |
Definition at line 83 of file TitleLinksTable.php.
MediaWiki\Deferred\LinksUpdate\TitleLinksTable::getTitleArray | ( | $setType | ) |
Get a link set as an array of Title objects.
This is memory-inefficient.
int | $setType |
Definition at line 67 of file TitleLinksTable.php.
|
abstractprotected |
Convert a link ID to a PageReferenceValue.
mixed | $linkId |
Reimplemented in MediaWiki\Deferred\LinksUpdate\CategoryLinksTable, MediaWiki\Deferred\LinksUpdate\GenericPageLinksTable, and MediaWiki\Deferred\LinksUpdate\ImageLinksTable.
|
protected |
Convert a link ID to a Title.
mixed | $linkId |
Reimplemented in MediaWiki\Deferred\LinksUpdate\CategoryLinksTable, MediaWiki\Deferred\LinksUpdate\GenericPageLinksTable, and MediaWiki\Deferred\LinksUpdate\ImageLinksTable.
Definition at line 30 of file TitleLinksTable.php.