mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Gadgets
synced 2024-11-24 07:23:30 +00:00
Override ContentHandler::getDeletionUpdates and ContentHandler::getSecondaryDataUpdates.
Use it instead of Content::getDeletionUpdates and Content::getSecondaryDataUpdates. Bug: T285730 Bug: T285729 Change-Id: Ie4ea0917f120809be59e2b7afad51cd189d64dd1
This commit is contained in:
parent
5b4ee6084f
commit
ffa6b4de09
|
@ -94,32 +94,4 @@ class GadgetDefinitionContent extends JsonContent {
|
|||
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param WikiPage $page
|
||||
* @param ParserOutput|null $parserOutput
|
||||
* @return DeferrableUpdate[]
|
||||
*/
|
||||
public function getDeletionUpdates( WikiPage $page, ParserOutput $parserOutput = null ) {
|
||||
return array_merge(
|
||||
parent::getDeletionUpdates( $page, $parserOutput ),
|
||||
[ new GadgetDefinitionDeletionUpdate( $page->getTitle() ) ]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Title $title
|
||||
* @param Content|null $old
|
||||
* @param bool $recursive
|
||||
* @param ParserOutput|null $parserOutput
|
||||
* @return DataUpdate[]
|
||||
*/
|
||||
public function getSecondaryDataUpdates( Title $title, Content $old = null,
|
||||
$recursive = true, ParserOutput $parserOutput = null
|
||||
) {
|
||||
return array_merge(
|
||||
parent::getSecondaryDataUpdates( $title, $old, $recursive, $parserOutput ),
|
||||
[ new GadgetDefinitionSecondaryDataUpdate( $title ) ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Copyright 2014
|
||||
*
|
||||
|
@ -20,6 +21,8 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
use MediaWiki\Revision\SlotRenderingProvider;
|
||||
|
||||
class GadgetDefinitionContentHandler extends JsonContentHandler {
|
||||
public function __construct() {
|
||||
parent::__construct( 'GadgetDefinition' );
|
||||
|
@ -64,4 +67,38 @@ class GadgetDefinitionContentHandler extends JsonContentHandler {
|
|||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Title $title The title of the page to supply the updates for.
|
||||
* @param string $role The role (slot) in which the content is being used.
|
||||
* @return DeferrableUpdate[] A list of DeferrableUpdate objects for putting information
|
||||
* about this content object somewhere.
|
||||
*/
|
||||
public function getDeletionUpdates( Title $title, $role ) {
|
||||
return array_merge(
|
||||
parent::getDeletionUpdates( $title, $role ),
|
||||
[ new GadgetDefinitionDeletionUpdate( $title ) ]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Title $title The title of the page to supply the updates for.
|
||||
* @param Content $content The content to generate data updates for.
|
||||
* @param string $role The role (slot) in which the content is being used.
|
||||
* @param SlotRenderingProvider $slotOutput A provider that can be used to gain access to
|
||||
* a ParserOutput of $content by calling $slotOutput->getSlotParserOutput( $role, false ).
|
||||
* @return DeferrableUpdate[] A list of DeferrableUpdate objects for putting information
|
||||
* about this content object somewhere.
|
||||
*/
|
||||
public function getSecondaryDataUpdates(
|
||||
Title $title,
|
||||
Content $content,
|
||||
$role,
|
||||
SlotRenderingProvider $slotOutput
|
||||
) {
|
||||
return array_merge(
|
||||
parent::getSecondaryDataUpdates( $title, $content, $role, $slotOutput ),
|
||||
[ new GadgetDefinitionSecondaryDataUpdate( $title ) ]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue