MediaWiki  master
ChangeTagsList.php
Go to the documentation of this file.
1 <?php
24 
33 abstract class ChangeTagsList extends RevisionListBase {
35  parent::__construct( $context, $page );
36  $this->ids = $ids;
37  }
38 
49  public static function factory( $typeName, IContextSource $context,
50  PageIdentity $page, array $ids
51  ) {
52  switch ( $typeName ) {
53  case 'revision':
54  $className = ChangeTagsRevisionList::class;
55  break;
56  case 'logentry':
57  $className = ChangeTagsLogList::class;
58  break;
59  default:
60  throw new Exception( "Class $typeName requested, but does not exist" );
61  }
62 
63  return new $className( $context, $page, $ids );
64  }
65 
69  public function reloadFromPrimary() {
70  $dbw = wfGetDB( DB_PRIMARY );
71  $this->res = $this->doQuery( $dbw );
72  }
73 
84  abstract public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
85  $reason, Authority $performer );
86 }
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
reloadFromPrimary()
Reload the list data from the primary DB.
__construct(IContextSource $context, PageIdentity $page, array $ids)
updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, Authority $performer)
Add/remove change tags from all the items in the list.
static factory( $typeName, IContextSource $context, PageIdentity $page, array $ids)
Creates a ChangeTags*List of the requested type.
IContextSource $context
List for revision table items for a single page.
PageIdentity $page
doQuery( $db)
Do the DB query to iterate through the objects.
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.
This interface represents the authority associated the current execution context, such as a web reque...
Definition: Authority.php:37
const DB_PRIMARY
Definition: defines.php:28