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
23 * Stores a list of taggable log entries.
26 class ChangeTagsLogList
extends ChangeTagsList
{
27 public function getType() {
32 * @param IDatabase $db
35 public function doQuery( $db ) {
36 $ids = array_map( 'intval', $this->ids
);
37 $queryInfo = DatabaseLogEntry
::getSelectQueryData();
38 $queryInfo['conds'] +
= array( 'log_id' => $ids );
39 $queryInfo['options'] +
= array( 'ORDER BY' => 'log_id DESC' );
40 ChangeTags
::modifyDisplayQuery(
44 $queryInfo['join_conds'],
45 $queryInfo['options'],
53 $queryInfo['options'],
54 $queryInfo['join_conds']
58 public function newItem( $row ) {
59 return new ChangeTagsLogItem( $this, $row );
63 * Add/remove change tags from all the log entries in the list.
65 * @param array $tagsToAdd
66 * @param array $tagsToRemove
67 * @param array $params
68 * @param string $reason
72 public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
75 // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
76 for ( $this->reset(); $this->current(); $this->next() ) {
77 // @codingStandardsIgnoreEnd
78 $item = $this->current();
79 $status = ChangeTags
::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
80 null, null, $item->getId(), $params, $reason, $user );
81 // Should only fail on second and subsequent times if the user trips
83 if ( !$status->isOK() ) {