2014-08-07 20:43:55 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
|
*
|
|
|
|
|
* @file
|
|
|
|
|
* @ingroup RevisionDelete
|
|
|
|
|
*/
|
|
|
|
|
|
2017-02-10 18:09:05 +00:00
|
|
|
use Wikimedia\Rdbms\IDatabase;
|
|
|
|
|
|
2014-08-07 20:43:55 +00:00
|
|
|
/**
|
|
|
|
|
* List for filearchive table items
|
|
|
|
|
*/
|
|
|
|
|
class RevDelArchivedFileList extends RevDelFileList {
|
|
|
|
|
public function getType() {
|
|
|
|
|
return 'filearchive';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getRelationType() {
|
|
|
|
|
return 'fa_id';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-12-09 09:05:22 +00:00
|
|
|
* @param IDatabase $db
|
2014-08-07 20:43:55 +00:00
|
|
|
* @return mixed
|
|
|
|
|
*/
|
|
|
|
|
public function doQuery( $db ) {
|
|
|
|
|
$ids = array_map( 'intval', $this->ids );
|
|
|
|
|
|
2017-10-06 17:03:55 +00:00
|
|
|
$fileQuery = ArchivedFile::getQueryInfo();
|
2014-08-08 13:55:19 +00:00
|
|
|
return $db->select(
|
2017-10-06 17:03:55 +00:00
|
|
|
$fileQuery['tables'],
|
|
|
|
|
$fileQuery['fields'],
|
2016-02-17 09:09:32 +00:00
|
|
|
[
|
2014-08-08 13:55:19 +00:00
|
|
|
'fa_name' => $this->title->getDBkey(),
|
|
|
|
|
'fa_id' => $ids
|
2016-02-17 09:09:32 +00:00
|
|
|
],
|
2014-08-08 13:55:19 +00:00
|
|
|
__METHOD__,
|
2017-10-06 17:03:55 +00:00
|
|
|
[ 'ORDER BY' => 'fa_id DESC' ],
|
|
|
|
|
$fileQuery['joins']
|
2014-08-08 13:55:19 +00:00
|
|
|
);
|
2014-08-07 20:43:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function newItem( $row ) {
|
|
|
|
|
return new RevDelArchivedFileItem( $this, $row );
|
|
|
|
|
}
|
2014-08-08 13:55:19 +00:00
|
|
|
}
|