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
19 * @ingroup RevisionDelete
22 use Wikimedia\Rdbms\IDatabase
;
25 * List for logging table items
27 class RevDelLogList
extends RevDelList
{
28 public function getType() {
32 public static function getRelationType() {
36 public static function getRestriction() {
37 return 'deletelogentry';
40 public static function getRevdelConstant() {
41 return LogPage
::DELETED_ACTION
;
44 public static function suggestTarget( $target, array $ids ) {
45 $result = wfGetDB( DB_REPLICA
)->select( 'logging',
51 if ( $result->numRows() == 1 ) {
52 // If there's only one type, the target can be set to include it.
53 return SpecialPage
::getTitleFor( 'Log', $result->current()->log_type
);
56 return SpecialPage
::getTitleFor( 'Log' );
60 * @param IDatabase $db
63 public function doQuery( $db ) {
64 $ids = array_map( 'intval', $this->ids
);
66 return $db->select( 'logging', [
82 [ 'ORDER BY' => 'log_id DESC' ]
86 public function newItem( $row ) {
87 return new RevDelLogItem( $this, $row );
90 public function getSuppressBit() {
91 return Revision
::DELETED_RESTRICTED
;
94 public function getLogAction() {
98 public function getLogParams( $params ) {
100 '4::ids' => $params['ids'],
101 '5::ofield' => $params['oldBits'],
102 '6::nfield' => $params['newBits'],