MediaWiki  master
MediaWiki\Deferred\LinksUpdate\PagePropsTable Class Reference

page_props More...

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

Public Member Functions

 __construct (ServiceOptions $options, JobQueueGroup $jobQueueGroup)
 
 getAssocArray ( $setType)
 Get the properties for a given link set as an associative array. More...
 
 setParserOutput (ParserOutput $parserOutput)
 Subclasses should implement this to extract the data they need from the ParserOutput. 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...
 
 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...
 

Public Attributes

const CONSTRUCTOR_OPTIONS = [ MainConfigNames::PagePropLinkInvalidations ]
 
- 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 Member Functions

 deleteLink ( $linkId)
 Delete a link identified by ID. More...
 
 finishUpdate ()
 Subclasses can override this to do any updates associated with their link data, for example dispatching HTML update jobs. More...
 
 getExistingFields ()
 Get the fields to be used in fetchExistingRows(). More...
 
 getExistingLinkIDs ()
 Get an array (or iterator) of link IDs for the existing state. More...
 
 getFromField ()
 Get the name of the field which links to page_id. More...
 
 getNewLinkIDs ()
 Get an array (or iterator) of link IDs for the new state. More...
 
 getTableName ()
 Get the table name. More...
 
 insertLink ( $linkId)
 Insert a link identified by ID. 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...
 
- Protected Member Functions inherited from MediaWiki\Deferred\LinksUpdate\LinksTable
 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...
 
 getBatchSize ()
 Get the maximum number of rows to update in a batch. More...
 
 getDB ()
 
 getFromConds ()
 Get field=>value associative array for the from field(s) 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...
 
 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...
 
 getTransactionTicket ()
 Get the empty transaction ticket, or null if there is none. More...
 
 insertRow ( $row)
 Queue a row for insertion. More...
 
 isCrossNamespaceMove ()
 Determine whether the page was moved to a different namespace. 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

- 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

page_props

Link ID format: string[] 0: Property name (pp_propname) 1: Property value (pp_value)

Since
1.38

Definition at line 20 of file PagePropsTable.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::__construct ( ServiceOptions  $options,
JobQueueGroup  $jobQueueGroup 
)

Member Function Documentation

◆ deleteLink()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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 146 of file PagePropsTable.php.

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

◆ finishUpdate()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::finishUpdate ( )
protected

Subclasses can override this to do any updates associated with their link data, for example dispatching HTML update jobs.

Stability: stable
to override

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 152 of file PagePropsTable.php.

◆ getAssocArray()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::getAssocArray (   $setType)

Get the properties for a given link set as an associative array.

Parameters
int$setTypeThe set type as in LinksTable::getLinkIDs()
Returns
array

Definition at line 193 of file PagePropsTable.php.

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

◆ getExistingFields()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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 63 of file PagePropsTable.php.

◆ getExistingLinkIDs()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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 88 of file PagePropsTable.php.

◆ getFromField()

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

Get the name of the field which links to page_id.

Returns
string

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 59 of file PagePropsTable.php.

◆ getNewLinkIDs()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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 67 of file PagePropsTable.php.

◆ getTableName()

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

Get the table name.

Returns
string

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 55 of file PagePropsTable.php.

◆ insertLink()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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 117 of file PagePropsTable.php.

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

◆ isExisting()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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 94 of file PagePropsTable.php.

◆ isInNewSet()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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 101 of file PagePropsTable.php.

◆ setParserOutput()

MediaWiki\Deferred\LinksUpdate\PagePropsTable::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.

Parameters
ParserOutput$parserOutput

Reimplemented from MediaWiki\Deferred\LinksUpdate\LinksTable.

Definition at line 51 of file PagePropsTable.php.

References ParserOutput\getPageProperties().

Member Data Documentation

◆ CONSTRUCTOR_OPTIONS

const MediaWiki\Deferred\LinksUpdate\PagePropsTable::CONSTRUCTOR_OPTIONS = [ MainConfigNames::PagePropLinkInvalidations ]

Definition at line 40 of file PagePropsTable.php.


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