* @private
*/
var $mId, //!< Page ID of the article linked from
- $mTitle, //!< Title object of the article linked from
- $mParserOutput, //!< Whether to queue jobs for recursive update
- $mLinks, //!< Map of title strings to IDs for the links in the document
+ $mTitle, //!< Title object of the article linked from
+ $mParserOutput, //!< Whether to queue jobs for recursive update
+ $mLinks, //!< Map of title strings to IDs for the links in the document
$mImages, //!< DB keys of the images used, in the array key only
$mTemplates, //!< Map of title strings to IDs for the template references, including broken ones
$mExternals, //!< URLs of external links, array key only
* @param $recursive Boolean: queue jobs for recursive updates?
*/
function __construct( $title, $parserOutput, $recursive = true ) {
- parent::__construct( );
+ parent::__construct( );
- if ( !is_object( $title ) ) {
- throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
- "Please see Article::editUpdates() for an invocation example.\n" );
- }
+ if ( !is_object( $title ) ) {
+ throw new MWException( "The calling convention to LinksUpdate::LinksUpdate() has changed. " .
+ "Please see Article::editUpdates() for an invocation example.\n" );
+ }
- if ( !is_object( $title ) ) {
- throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " .
+ if ( !is_object( $title ) ) {
+ throw new MWException( "The calling convention to LinksUpdate::__construct() has changed. " .
"Please see WikiPage::doEditUpdates() for an invocation example.\n" );
- }
- $this->mTitle = $title;
- $this->mId = $title->getArticleID();
+ }
+ $this->mTitle = $title;
+ $this->mId = $title->getArticleID();
- $this->mParserOutput = $parserOutput;
+ $this->mParserOutput = $parserOutput;
$this->mLinks = $parserOutput->getLinks();
$this->mImages = $parserOutput->getImages();
$this->invalidatePages( NS_FILE, array_keys( $images ) );
}
- /**
- * @param $table
- * @param $insertions
- * @param $fromField
- */
- private function dumbTableUpdate( $table, $insertions, $fromField ) {
- $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
- if ( count( $insertions ) ) {
- # The link array was constructed without FOR UPDATE, so there may
- # be collisions. This may cause minor link table inconsistencies,
- # which is better than crippling the site with lock contention.
- $this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
- }
- }
+ /**
+ * @param $table
+ * @param $insertions
+ * @param $fromField
+ */
+ private function dumbTableUpdate( $table, $insertions, $fromField ) {
+ $this->mDb->delete( $table, array( $fromField => $this->mId ), __METHOD__ );
+ if ( count( $insertions ) ) {
+ # The link array was constructed without FOR UPDATE, so there may
+ # be collisions. This may cause minor link table inconsistencies,
+ # which is better than crippling the site with lock contention.
+ $this->mDb->insert( $table, $insertions, __METHOD__, array( 'IGNORE' ) );
+ }
+ }
/**
* Update a table by doing a delete query then an insert query
return $arr;
}
- /**
- * Return the title object of the page being updated
- * @return Title
- */
- public function getTitle() {
- return $this->mTitle;
- }
-
- /**
- * Returns parser output
- * @since 1.19
- * @return ParserOutput
- */
- public function getParserOutput() {
- return $this->mParserOutput;
- }
+ /**
+ * Return the title object of the page being updated
+ * @return Title
+ */
+ public function getTitle() {
+ return $this->mTitle;
+ }
+
+ /**
+ * Returns parser output
+ * @since 1.19
+ * @return ParserOutput
+ */
+ public function getParserOutput() {
+ return $this->mParserOutput;
+ }
/**
* Return the list of images used as generated by the parser