MediaWiki  master
ChangeTagsList.php
Go to the documentation of this file.
1 <?php
30 abstract class ChangeTagsList extends RevisionListBase {
32  parent::__construct( $context, $title );
33  $this->ids = $ids;
34  }
35 
46  public static function factory( $typeName, IContextSource $context,
47  Title $title, array $ids
48  ) {
49  switch ( $typeName ) {
50  case 'revision':
51  $className = ChangeTagsRevisionList::class;
52  break;
53  case 'logentry':
54  $className = ChangeTagsLogList::class;
55  break;
56  default:
57  throw new Exception( "Class $typeName requested, but does not exist" );
58  }
59 
60  return new $className( $context, $title, $ids );
61  }
62 
66  function reloadFromMaster() {
67  $dbw = wfGetDB( DB_MASTER );
68  $this->res = $this->doQuery( $dbw );
69  }
70 
81  abstract function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
82  $reason, $user );
83 }
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
IContextSource $context
const DB_MASTER
Definition: defines.php:26
__construct(IContextSource $context, Title $title, array $ids)
List for revision table items for a single page.
doQuery( $db)
Do the DB query to iterate through the objects.
updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user)
Add/remove change tags from all the items in the list.
static factory( $typeName, IContextSource $context, Title $title, array $ids)
Creates a ChangeTags*List of the requested type.
reloadFromMaster()
Reload the list data from the master DB.