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 * Generic list for change tagging.
25 * @property ChangeTagsLogItem $current
26 * @method ChangeTagsLogItem next()
27 * @method ChangeTagsLogItem reset()
28 * @method ChangeTagsLogItem current()
29 * @phan-file-suppress PhanParamSignatureMismatch
31 abstract class ChangeTagsList
extends RevisionListBase
{
32 function __construct( IContextSource
$context, Title
$title, array $ids ) {
33 parent
::__construct( $context, $title );
38 * Creates a ChangeTags*List of the requested type.
40 * @param string $typeName 'revision' or 'logentry'
41 * @param IContextSource $context
44 * @return ChangeTagsList An instance of the requested subclass
45 * @throws Exception If you give an unknown $typeName
47 public static function factory( $typeName, IContextSource
$context,
48 Title
$title, array $ids
50 switch ( $typeName ) {
52 $className = ChangeTagsRevisionList
::class;
55 $className = ChangeTagsLogList
::class;
58 throw new Exception( "Class $typeName requested, but does not exist" );
61 return new $className( $context, $title, $ids );
65 * Reload the list data from the master DB.
67 function reloadFromMaster() {
68 $dbw = wfGetDB( DB_MASTER
);
69 $this->res
= $this->doQuery( $dbw );
73 * Add/remove change tags from all the items in the list.
75 * @param array $tagsToAdd
76 * @param array $tagsToRemove
77 * @param string|null $params
78 * @param string $reason
82 abstract function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,