47 return 'deleterevision';
56 return $rev ?
$rev->getTitle() : $target;
64 $ids = array_map(
'intval', $this->ids );
66 'tables' => [
'revision',
'page',
'user' ],
69 'rev_page' => $this->title->getArticleID(),
73 'ORDER BY' =>
'rev_id DESC',
74 'USE INDEX' => [
'revision' =>
'PRIMARY' ]
85 $queryInfo[
'join_conds'],
86 $queryInfo[
'options'],
95 $queryInfo[
'options'],
96 $queryInfo[
'join_conds']
98 if ( $live->numRows() >= count(
$ids ) ) {
103 $archiveQueryInfo = [
104 'tables' => [
'archive' ],
109 'options' => [
'ORDER BY' =>
'ar_rev_id DESC' ],
114 $archiveQueryInfo[
'tables'],
115 $archiveQueryInfo[
'fields'],
116 $archiveQueryInfo[
'conds'],
117 $archiveQueryInfo[
'join_conds'],
118 $archiveQueryInfo[
'options'],
123 $archived = $db->select(
124 $archiveQueryInfo[
'tables'],
125 $archiveQueryInfo[
'fields'],
126 $archiveQueryInfo[
'conds'],
128 $archiveQueryInfo[
'options'],
129 $archiveQueryInfo[
'join_conds']
132 if ( $archived->numRows() == 0 ) {
134 } elseif ( $live->numRows() == 0 ) {
139 foreach ( $live as $row ) {
140 $rows[$row->rev_id] = $row;
142 foreach ( $archived as $row ) {
143 $rows[$row->ar_rev_id] = $row;
151 if ( isset( $row->rev_id ) ) {
153 } elseif ( isset( $row->ar_rev_id ) ) {
157 throw new MWException(
'Invalid row type in RevDelRevisionList' );
162 if ( is_null( $this->currentRevId ) ) {
164 $this->currentRevId = $dbw->selectField(
165 'page',
'page_latest', $this->title->pageCond(), __METHOD__ );
175 $this->title->invalidateCache();
176 return Status::newGood();
180 $this->title->purgeSquid();
182 Hooks::run(
'ArticleRevisionVisibilitySet', [ $this->title, $this->ids, $visibilityChangeMap ] );
183 return Status::newGood();
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Item class for a archive table row by ar_rev_id – actually used via RevDelRevisionList.
Abstract base class for a list of deletable items.
Item class for a live revision table row.
List for revision table items.
getSuppressBit()
Get the integer value of the flag used for suppression.
doPostCommitUpdates(array $visibilityChangeMap)
A hook for setVisibility(): do any necessary updates post-commit.
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
static getRelationType()
Get the DB field name associated with the ID list.
static suggestTarget( $target, array $ids)
Suggest a target for the revision deletion Optionally override this function.
static getRestriction()
Get the user right required for this list type Override this function.
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
getType()
Get the internal type name of this list.
newItem( $row)
Create an item object from a DB result row.
static selectArchiveFields()
Return the list of revision fields that should be selected to create a new revision from an archive r...
static userJoinCond()
Return the value of a select() JOIN conds array for the user table.
static selectFields()
Return the list of revision fields that should be selected to create a new revision.
static selectUserFields()
Return the list of user fields that should be selected from user table.
static pageJoinCond()
Return the value of a select() page conds array for the page table.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev