38 $title = Title::newFromText( $term );
47 $termMain = $termDb = $term;
52 $engine->setLimitOffset( 100 );
53 $engine->setNamespaces( [ $ns ] );
54 $results = $engine->searchArchiveTitle( $termMain );
55 if ( !$results->isOK() ) {
58 $results = $results->getValue();
67 $condTitles = array_values( array_unique( array_map(
static function (
Title $t ) {
68 return $t->getDBkey();
71 'ar_namespace' => $ns,
72 $dbr->expr(
'ar_title',
'=', $condTitles )
73 ->or(
'ar_title', IExpression::LIKE,
new LikeValue( $termDb, $dbr->anyString() ) ),
90 $title = Title::newFromText( $prefix );
101 'ar_namespace' => $ns,
102 $dbr->expr(
'ar_title', IExpression::LIKE,
new LikeValue( $prefix, $dbr->anyString() ) ),
115 ->select( [
'ar_namespace',
'ar_title',
'count' =>
'COUNT(*)' ] )
117 ->where( $condition )
118 ->groupBy( [
'ar_namespace',
'ar_title' ] )
119 ->orderBy( [
'ar_namespace',
'ar_title' ] )
121 ->caller( __METHOD__ )->fetchResultSet();
133 if ( $this->title->getNamespace() !==
NS_FILE ) {
138 $queryBuilder = FileSelectQueryBuilder::newForArchivedFile( $dbr );
139 $queryBuilder->where( [
'fa_name' => $this->title->getDBkey() ] )
140 ->orderBy(
'fa_timestamp', SelectQueryBuilder::SORT_DESC );
141 return $queryBuilder->caller( __METHOD__ )->fetchResultSet();
147class_alias( PageArchive::class,
'PageArchive' );
Used to show archived pages and eventually restore them.
static listPagesBySearch( $term)
List deleted pages recorded in the archive matching the given term, using search engine archive.
static listPages(IReadableDatabase $dbr, $condition)
__construct(Title $title)
static listPagesByPrefix( $prefix)
List deleted pages recorded in the archive table matching the given title prefix.
listFiles()
List the deleted file revisions for this page, if it's a file page.