34 'revision' => RevDelRevisionList::class,
35 'archive' => RevDelArchiveList::class,
36 'oldimage' => RevDelFileList::class,
37 'filearchive' => RevDelArchivedFileList::class,
38 'logging' => RevDelLogList::class,
43 'oldid' =>
'revision',
44 'artimestamp' =>
'archive',
45 'oldimage' =>
'oldimage',
46 'fileid' =>
'filearchive',
57 return array_keys( self::$allowedTypes );
68 if ( isset( self::$deprecatedTypeMap[$typeName] ) ) {
69 $typeName = self::$deprecatedTypeMap[$typeName];
71 return isset( self::$allowedTypes[$typeName] ) ? $typeName :
null;
88 throw new MWException( __METHOD__ .
": Unknown RevDel type '$typeName'" );
90 $class = self::$allowedTypes[$typeName];
105 protected static function checkItem( $desc, $field, $diff, $new, &$arr ) {
106 if ( $diff & $field ) {
107 $arr[( $new & $field ) ? 0 : 1][] = $desc;
131 $ret = [ 0 => [], 1 => [], 2 => [] ];
134 RevisionRecord::DELETED_TEXT, $diff, $n, $ret );
136 RevisionRecord::DELETED_COMMENT, $diff, $n, $ret );
138 RevisionRecord::DELETED_USER, $diff, $n, $ret );
140 if ( $diff & RevisionRecord::DELETED_RESTRICTED ) {
141 if ( $n & RevisionRecord::DELETED_RESTRICTED ) {
142 $ret[2][] =
'revdelete-restricted';
144 $ret[2][] =
'revdelete-unrestricted';
161 return call_user_func( [ self::$allowedTypes[$typeName],
'getRelationType' ] );
175 return call_user_func( [ self::$allowedTypes[$typeName],
'getRestriction' ] );
189 return call_user_func( [ self::$allowedTypes[$typeName],
'getRevdelConstant' ] );
205 return call_user_func( [ self::$allowedTypes[$typeName],
'suggestTarget' ], $target, $ids );
219 $exists =
$dbr->selectField(
'revision',
'1',
220 [
'rev_id' => $revid ], __METHOD__ );
226 $timestamp =
$dbr->selectField(
'archive',
'ar_timestamp',
227 [
'ar_namespace' =>
$title->getNamespace(),
228 'ar_title' =>
$title->getDBkey(),
229 'ar_rev_id' => $revid ], __METHOD__ );
244 foreach ( $bitPars as $const => $val ) {
247 } elseif ( $val == -1 ) {
248 $newBits |= ( $oldfield & $const );