MediaWiki master
PageArchive Class Reference

Used to show archived pages and eventually restore them. More...

Collaboration diagram for PageArchive:

Public Member Functions

 __construct (Title $title)
 
 listFiles ()
 List the deleted file revisions for this page, if it's a file page.
 
 undeleteAsUser ( $timestamps, UserIdentity $user, $comment='', $fileVersions=[], $unsuppress=false, $tags=null)
 Restore the given (or all) text and file revisions for the page.
 

Static Public Member Functions

static listPagesByPrefix ( $prefix)
 List deleted pages recorded in the archive table matching the given title prefix.
 
static listPagesBySearch ( $term)
 List deleted pages recorded in the archive matching the given term, using search engine archive.
 

Static Protected Member Functions

static listPages (IReadableDatabase $dbr, $condition)
 

Protected Attributes

Title $title
 

Detailed Description

Used to show archived pages and eventually restore them.

Definition at line 35 of file PageArchive.php.

Constructor & Destructor Documentation

◆ __construct()

PageArchive::__construct ( Title  $title)
Parameters
Title$title

Definition at line 43 of file PageArchive.php.

Member Function Documentation

◆ listFiles()

PageArchive::listFiles ( )

List the deleted file revisions for this page, if it's a file page.

Returns a result wrapper with various filearchive fields, or null if not a file page.

Returns
IResultWrapper|null
Todo:
Does this belong in Image for fuller encapsulation?

Definition at line 150 of file PageArchive.php.

References NS_FILE.

◆ listPages()

static PageArchive::listPages ( IReadableDatabase  $dbr,
  $condition 
)
staticprotected
Parameters
IReadableDatabase$dbr
string | array$condition
Returns
IResultWrapper

Definition at line 131 of file PageArchive.php.

References Wikimedia\Rdbms\IReadableDatabase\newSelectQueryBuilder().

◆ listPagesByPrefix()

static PageArchive::listPagesByPrefix (   $prefix)
static

List deleted pages recorded in the archive table matching the given title prefix.

Returns result wrapper with (ar_namespace, ar_title, count) fields.

Parameters
string$prefixTitle prefix
Returns
IResultWrapper|bool

Definition at line 105 of file PageArchive.php.

References MediaWiki\Title\Title\getDBkey(), and MediaWiki\Title\Title\getNamespace().

◆ listPagesBySearch()

static PageArchive::listPagesBySearch (   $term)
static

List deleted pages recorded in the archive matching the given term, using search engine archive.

Returns result wrapper with (ar_namespace, ar_title, count) fields.

Parameters
string$termSearch term
Returns
IResultWrapper|bool

Definition at line 55 of file PageArchive.php.

References MediaWiki\Title\Title\getDBkey(), MediaWiki\Title\Title\getNamespace(), and MediaWiki\Title\Title\getText().

◆ undeleteAsUser()

PageArchive::undeleteAsUser (   $timestamps,
UserIdentity  $user,
  $comment = '',
  $fileVersions = [],
  $unsuppress = false,
  $tags = null 
)

Restore the given (or all) text and file revisions for the page.

Once restored, the items will be removed from the archive tables. The deletion log will be updated with an undeletion notice.

Since
1.35
Deprecated:
since 1.38, use UndeletePage instead
Parameters
array$timestampsPass an empty array to restore all revisions, otherwise list the ones to undelete.
UserIdentity$user
string$comment
array$fileVersions
bool$unsuppress
string | string[] | null$tagsChange tags to add to log entry ($user should be able to add the specified tags before this is called)
Returns
array|false [ number of file revisions restored, number of image revisions restored, log message ] on success, false on failure.

Definition at line 181 of file PageArchive.php.

Member Data Documentation

◆ $title

Title PageArchive::$title
protected

Definition at line 38 of file PageArchive.php.


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