Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / specials / pagers / DeletedContribsPager.php
blobfb4350a38017872659245d13ab914b5f4553ec08
1 <?php
2 /**
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
18 * @file
19 * @ingroup Pager
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;
35 /**
36 * @ingroup Pager
38 class DeletedContribsPager extends ContributionsPager {
39 /**
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,
62 array $options,
63 $target
64 ) {
65 $options['isArchive'] = true;
67 parent::__construct(
68 $linkRenderer,
69 $linkBatchFactory,
70 $hookContainer,
71 $revisionStore,
72 $namespaceInfo,
73 $commentFormatter,
74 $userFactory,
75 $context,
76 $options,
77 $target
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';
91 /**
92 * @inheritDoc
94 protected function getRevisionQuery() {
95 $queryBuilder = $this->revisionStore->newArchiveSelectQueryBuilder( $this->getDatabase() )
96 ->joinComment()
97 ->where( [ 'actor_name' => $this->target ] );
99 return $queryBuilder->getQueryInfo();
103 * @return string[]
105 protected function getExtraSortFields() {
106 return [ 'ar_id' ];
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' );