MediaWiki master
|
categorylinks More...
Inherits MediaWiki\Deferred\LinksUpdate\TitleLinksTable.
Public Member Functions | |
__construct (LanguageConverterFactory $converterFactory, NamespaceInfo $namespaceInfo, WikiPageFactory $wikiPageFactory, ILoadBalancer $loadBalancer, WANObjectCache $WANObjectCache, Config $config, Collation $collation, $collationName, $tableName, $isTempTable) | |
setParserOutput (ParserOutput $parserOutput) | |
Subclasses should implement this to extract the data they need from the ParserOutput. | |
startUpdate () | |
Cache the category type after the source page has been set. | |
![]() | |
getPageReferenceIterator ( $setType) | |
Get a link set as an iterator over PageReferenceValue objects. | |
getTitleArray ( $setType) | |
Get a link set as an array of Title objects. | |
![]() | |
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. | |
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. | |
deleteLink ( $linkId) | |
Delete a link identified by ID. | |
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. | |
getExistingFields () | |
Get the fields to be used in fetchExistingRows(). | |
getExistingLinkIDs () | |
getFromField () | |
Get the name of the field which links to page_id. | |
getNewLinkIDs () | |
Get the new link IDs. | |
getTableName () | |
Get the table name. | |
insertLink ( $linkId) | |
Insert a link identified by ID. | |
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. | |
linksTargetNormalizationStage () | |
Normalization stage of the links table (see T222224) | |
makePageReferenceValue ( $linkId) | |
Convert a link ID to a PageReferenceValue. | |
makeTitle ( $linkId) | |
Convert a link ID to a Title. | |
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. | |
![]() | |
getDeduplicatedLinkIds ( $setType) | |
Get link IDs for a given set type, filtering out duplicate links to the same title. | |
![]() | |
deleteRow ( $conds) | |
Queue a deletion operation. | |
doWrites () | |
Do the common DB operations. | |
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. | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
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 |
categorylinks
Link ID format: string[]
Definition at line 34 of file CategoryLinksTable.php.
MediaWiki\Deferred\LinksUpdate\CategoryLinksTable::__construct | ( | LanguageConverterFactory | $converterFactory, |
NamespaceInfo | $namespaceInfo, | ||
WikiPageFactory | $wikiPageFactory, | ||
ILoadBalancer | $loadBalancer, | ||
WANObjectCache | $WANObjectCache, | ||
Config | $config, | ||
Collation | $collation, | ||
$collationName, | |||
$tableName, | |||
$isTempTable ) |
LanguageConverterFactory | $converterFactory | |
NamespaceInfo | $namespaceInfo | |
WikiPageFactory | $wikiPageFactory | |
ILoadBalancer | $loadBalancer | |
WANObjectCache | $WANObjectCache | |
Config | $config | |
Collation | $collation | |
string | $collationName | |
string | $tableName | |
bool | $isTempTable |
Definition at line 99 of file CategoryLinksTable.php.
References MediaWiki\MainConfigNames\CategoryLinksSchemaMigrationStage, and MediaWiki\Languages\LanguageConverterFactory\getLanguageConverter().
|
protected |
Given an iterator over link IDs, remove links which go to the same title, leaving only one link per title.
iterable<mixed> | $linkIds |
Reimplemented from MediaWiki\Deferred\LinksUpdate\TitleLinksTable.
Definition at line 329 of file CategoryLinksTable.php.
|
protected |
Delete a link identified by ID.
The subclass is expected to queue the deletion by calling deleteRow().
mixed | $linkId |
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 303 of file CategoryLinksTable.php.
References MediaWiki\Deferred\LinksUpdate\LinksTable\deleteRow(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\linksTargetNormalizationStage(), and SCHEMA_COMPAT_WRITE_OLD.
|
protected |
Do a select query to fetch the existing rows.
This is a helper for subclasses.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 413 of file CategoryLinksTable.php.
|
protected |
Subclasses can override this to do any updates associated with their link data, for example dispatching HTML update jobs.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 339 of file CategoryLinksTable.php.
|
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.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 189 of file CategoryLinksTable.php.
References MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\linksTargetNormalizationStage(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\needForcedLinkRefresh(), and SCHEMA_COMPAT_WRITE_OLD.
|
protected |
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 256 of file CategoryLinksTable.php.
|
protected |
Get the name of the field which links to page_id.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 185 of file CategoryLinksTable.php.
|
protected |
Get the new link IDs.
The link ID is a list with the name in the first element and the sort key prefix in the second element.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 207 of file CategoryLinksTable.php.
|
protected |
Get the table name.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 181 of file CategoryLinksTable.php.
|
protected |
Insert a link identified by ID.
The subclass is expected to queue the insertion by calling insertRow().
mixed | $linkId |
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 274 of file CategoryLinksTable.php.
References MediaWiki\Deferred\LinksUpdate\LinksTable\getDB(), MediaWiki\Deferred\LinksUpdate\LinksTable\insertRow(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\linksTargetNormalizationStage(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\makeTitle(), SCHEMA_COMPAT_WRITE_NEW, and SCHEMA_COMPAT_WRITE_OLD.
|
protected |
Determine whether a link (from the new set) is in the existing set.
mixed | $linkId |
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 262 of file CategoryLinksTable.php.
|
protected |
Determine whether a link (from the existing set) is in the new set.
mixed | $linkId |
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 268 of file CategoryLinksTable.php.
|
protected |
Normalization stage of the links table (see T222224)
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 409 of file CategoryLinksTable.php.
Referenced by MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\deleteLink(), MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\getExistingFields(), and MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\insertLink().
|
protected |
Convert a link ID to a PageReferenceValue.
mixed | $linkId |
Reimplemented from MediaWiki\Deferred\LinksUpdate\TitleLinksTable.
Definition at line 321 of file CategoryLinksTable.php.
|
protected |
Convert a link ID to a Title.
mixed | $linkId |
Reimplemented from MediaWiki\Deferred\LinksUpdate\TitleLinksTable.
Definition at line 325 of file CategoryLinksTable.php.
Referenced by MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\insertLink().
|
protected |
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.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 316 of file CategoryLinksTable.php.
References MediaWiki\Deferred\LinksUpdate\LinksTable\isMove().
Referenced by MediaWiki\Deferred\LinksUpdate\CategoryLinksTable\getExistingFields().
MediaWiki\Deferred\LinksUpdate\CategoryLinksTable::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 141 of file CategoryLinksTable.php.
References MediaWiki\Parser\ParserOutput\getCategoryNames(), MediaWiki\Parser\ParserOutput\getCategorySortKey(), MediaWiki\Parser\ParserOutput\getPageProperty(), MediaWiki\Deferred\LinksUpdate\LinksTable\getSourcePage(), and NS_CATEGORY.
MediaWiki\Deferred\LinksUpdate\CategoryLinksTable::startUpdate | ( | ) |
Cache the category type after the source page has been set.
Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.
Definition at line 136 of file CategoryLinksTable.php.
References MediaWiki\Deferred\LinksUpdate\LinksTable\getSourcePage().