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 Change tagging
22 use Wikimedia\Rdbms\IDatabase
;
25 * Stores a list of taggable log entries.
28 class ChangeTagsLogList
extends ChangeTagsList
{
29 public function getType() {
34 * @param IDatabase $db
37 public function doQuery( $db ) {
38 $ids = array_map( 'intval', $this->ids
);
39 $queryInfo = DatabaseLogEntry
::getSelectQueryData();
40 $queryInfo['conds'] +
= [ 'log_id' => $ids ];
41 $queryInfo['options'] +
= [ 'ORDER BY' => 'log_id DESC' ];
42 ChangeTags
::modifyDisplayQuery(
46 $queryInfo['join_conds'],
47 $queryInfo['options'],
55 $queryInfo['options'],
56 $queryInfo['join_conds']
60 public function newItem( $row ) {
61 return new ChangeTagsLogItem( $this, $row );
65 * Add/remove change tags from all the log entries in the list.
67 * @param array $tagsToAdd
68 * @param array $tagsToRemove
69 * @param array $params
70 * @param string $reason
74 public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
77 // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
78 for ( $this->reset(); $this->current(); $this->next() ) {
79 // @codingStandardsIgnoreEnd
80 $item = $this->current();
81 $status = ChangeTags
::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
82 null, null, $item->getId(), $params, $reason, $user );
83 // Should only fail on second and subsequent times if the user trips
85 if ( !$status->isOK() ) {