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