3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
22 namespace MediaWiki\Pager
;
24 use MediaWiki\Cache\LinkBatchFactory
;
25 use MediaWiki\CommentFormatter\CommentFormatter
;
26 use MediaWiki\Context\IContextSource
;
27 use MediaWiki\HookContainer\HookContainer
;
28 use MediaWiki\Linker\LinkRenderer
;
29 use MediaWiki\Revision\RevisionStore
;
30 use MediaWiki\Title\NamespaceInfo
;
31 use MediaWiki\User\UserFactory
;
32 use MediaWiki\User\UserIdentity
;
33 use Wikimedia\Rdbms\IConnectionProvider
;
38 class DeletedContribsPager
extends ContributionsPager
{
40 * @param HookContainer $hookContainer
41 * @param LinkRenderer $linkRenderer
42 * @param IConnectionProvider $dbProvider
43 * @param RevisionStore $revisionStore
44 * @param NamespaceInfo $namespaceInfo
45 * @param CommentFormatter $commentFormatter
46 * @param LinkBatchFactory $linkBatchFactory
47 * @param UserFactory $userFactory
48 * @param IContextSource $context
49 * @param array $options
50 * @param UserIdentity $target
52 public function __construct(
53 HookContainer
$hookContainer,
54 LinkRenderer
$linkRenderer,
55 IConnectionProvider
$dbProvider,
56 RevisionStore
$revisionStore,
57 NamespaceInfo
$namespaceInfo,
58 CommentFormatter
$commentFormatter,
59 LinkBatchFactory
$linkBatchFactory,
60 UserFactory
$userFactory,
61 IContextSource
$context,
65 $options['isArchive'] = true;
80 $this->revisionIdField
= 'ar_rev_id';
81 $this->revisionParentIdField
= 'ar_parent_id';
82 $this->revisionTimestampField
= 'ar_timestamp';
83 $this->revisionLengthField
= 'ar_len';
84 $this->revisionDeletedField
= 'ar_deleted';
85 $this->revisionMinorField
= 'ar_minor_edit';
86 $this->userNameField
= 'ar_user_text';
87 $this->pageNamespaceField
= 'ar_namespace';
88 $this->pageTitleField
= 'ar_title';
94 protected function getRevisionQuery() {
95 $queryBuilder = $this->revisionStore
->newArchiveSelectQueryBuilder( $this->getDatabase() )
97 ->where( [ 'actor_name' => $this->target
] );
99 return $queryBuilder->getQueryInfo();
105 protected function getExtraSortFields() {
109 public function getIndexField() {
110 return 'ar_timestamp';
115 * Retain the old class name for backwards compatibility.
116 * @deprecated since 1.41
118 class_alias( DeletedContribsPager
::class, 'DeletedContribsPager' );